energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
794 stars 672 forks source link

need to write/read tiva registers in energia #310

Closed blueminerals closed 10 years ago

blueminerals commented 10 years ago

I would like to write and read tiva registers in energia, but it crashes on the register name below. This is a bug

the "inc/tm4c123gh6pm.h" file contains #define ADC0_SSFIFO3_R (((volatile uint32_t )0x400380A8))

include "inc/tm4c123gh6pm.h" // ti register names

include "inc/hw_adc.h"

include "Wire.h"

void setup() {
Serial.begin(9600); unsigned long reg = ADC0_SSFIFO3_R; // compiles but crashes when running it

}

blueminerals commented 10 years ago

Analog-to-Digital Converter Run Mode Clock Gating Control (RCGCADC), offset 0x638 must be enabled before reading or writing adc registers. So if you don't do this, it hangs. It may be that other sections need to be enabled before read or writing.