Reply
Highlighted
Posts: 50
Registered: ‎06-10-2016

Autoscan Endianness Control

There are not too many posts about autoscan in this forum so I might be something of a trailblazer. After a lot of reading and reviewing (AN919 and EFM8LB1-RM), I finally got autoscan working. But there's only one small problem that I'm seeing now. It appears that the bit setting for ENDIAN in the ADC0ASAL register is backwards. In other words, if I set it to zero, I'm getting LITTLE_ENDIAN behavior.

 

In the enclosed screen grab my code is shown at the top while the results of my scan stored in XDATA are shown in the bottom. I've set the input to 1.2 volts, the reference is 2.4 volts, and the ADC resolution is 12 bits. According to the documentation on page 158 of EFM8LB1-RM, my numbers should be BIG_ENDIAN and should look like 07FC07FFD and so on. Instead, I'm seeing the opposite.

Capture.PNG

Am I doing something stupid or do I win a prize? 

 

 

Posts: 229
Registered: ‎08-19-2015

Re: Autoscan Endianness Control

Hi @WallyWare,

 

Thank you for contacting Silicon Labs regarding the endianness of the EFM8LB1 ADC autoscan feature.  Based on my tests, I have confirmed that your report appears to be true, and that a setting of '0' in the ENDIAN field of ADC0ASAL seems to make the device store ADC results in little endian format (default), while a setting of '1' appears to configure the device to store results in big endian format.  I am going to escalate this case to create a support ticket for issue tracking, and I will report this issue internally.  I expect that we will further confirm this observations and issue a change to the reference manual in a future reference manual update.  Thank you, and let me know if you have any questions.

 

Regards,

Mitch

MCU Applications Engineer

Posts: 50
Registered: ‎06-10-2016

Re: Autoscan Endianness Control

Actually, I think I figured out the problem. The Laser Bee is writing the data to XRAM correctly. The problem is that Simplicity Studio defaults to -displaying- the data in Little Endian format. Right clicking anywhere in the memory pane not only lets you change the ENDIAN format, but there's also a Cell Size option that lets you display the data as 1, 2, 4, and 8 bytes. If you set the cell size to 1 byte then changing the ENDIAN format has no affect and the data is in the correct format.

Posts: 229
Registered: ‎08-19-2015

Re: Autoscan Endianness Control

Hi @WallyWare,

 

Thank you for your response - that makes sense now about the Simplicity Studio display settings, though I thought I had initially confirmed your initial conclusion.  Thanks for mentioning that Simplicity Studio does indeed allow for flexible data display, which was misleading in this case. 

 

Regards,

Mitch

Posts: 1
Registered: ‎11-22-2016

Re: Autoscan Endianness Control

Hi @WallyWare,

 

I'm working on a similar project to get autoscan up and running. Would you mind posting the rest of your initialization code? I've been having trouble accessing the XRAM data - would love to see a good working example. 

 

 

 

Best regards,

Aaron

Posts: 50
Registered: ‎06-10-2016

Re: Autoscan Endianness Control

Aaron,

 

The biggest trick to getting the data out of XRAM is to declare the pointer correctly. That will let the compiler know that you want to access that area of memory. See the oscilloscope example for the eval board.

Posts: 469
Registered: ‎02-21-2014

Re: Autoscan Endianness Control

Hi Aaocohen,

 

There are a few Autoscan examples for the LB1. You can find them under ADC/Peripheral Driver. Perhaps those would be a good start?

 

-Brian