This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC conversion and sample sequencer 1

Hi all, 

im new to the ARM processors and have recently purchased a Stellaris Launchpad (EK-LM4F120XL) (which i now realise have been rebranded as Tiva).

Nevertheless i am attempting to use the ADC module with sequencer one to experiment with the on chip temperature sensor in C using IAR Embedded Workbench. Essentially I'm following section 5.5 of this guide:

http://software-dl.ti.com/trainingTTO/trainingTTO_public_sw/GSW-Stellaris-LaunchPad/StellarisLaunchPadWorkbook.pdf

but without using the libraries (because it will force me to learn the fundamentals of the Micro, and also because i cant seem to find the .h files anywhere!).

Anyway:

Once i've set the PLL for 40Mhz and turned on the ADC to my specified freq, attempting to disable sample sequencer 1 generates a bus fault. when simulating on the board and i cant figure out why.. i have attached the corresponding c code and also the disassembly listing. any help would be much appreciated.

  • Hi Joseph,

       There is an example code for reading the internal temperature sensor. You can find it here "TivaWare_C_Series-1.0\examples\peripherals\adc". Review how the internals of each function works. See, the Peripherals Drivers Library Users Guide for reference.

    -kel

  • Thanks Kel,

    The example in the folder is identical to the one i am following. Because it does the same steps but using the library files(which i have now installed). Using the disassembly window ive found that the software reads the first line of each equivalent c function then instead of continuing to execute the assembly functions which comprise the c function it just skips to the next line, and repeats the same process. 

    Ive verified this by inspection and by analysing the program counter. This means that none of the C instructions are actually being executed. Ive repeated with all levels of optimisation and cant figure out why its doing this, but i guess isolating the issue is only half the battle

  • Hi Joseph,

        I have tested the temperature example code, and I assure you it works. Regarding your observation, while stepping through the c code and assembly language, I don't have a certain answer. Just wait for the others to reply. Maybe, that's normal.

    -kel