I'm currently working on the LPC2378 with an application board connected, the application board has quite a few components, for now let's assume it has a motor control (fan), a heater control, and an ADC which is configured to read temperature(Through a slider on the app board). The temperature of the heater may be input at any time by reading bits 8::15 of Port4. This 8-bit value represents the instantaneous temperature of the sensor.
How would I go about reading the ADC for the temperature value in ARM assembly?
Here is the code for turning my heater on(which is on bit 5 of port 4):
;==============================================================================
; Turn Heater On
;==============================================================================
heaterOn
STMFD r13!,{r0,r5,r14} ; Push r0, r5 and LR
LDR R5, =FIO4PIN ; Address of FIO4PIN
LDR r0, [r5] ; Read current Port4
ORR r0, r0, #0x20
STR r0, [r5] ; Output
LDMFD r13!,{r0,r5,r14} ; Pop r0, r5 and LR
mov pc, r14 ; Put link register back into PC
As far as I know I have to set a register to 8 bits, then set the register to the adc temp value, but I have no clue how to actually get the value from the ADC.

New Topic/Question
Reply


MultiQuote






|