This program demonstrates the usage of the ADC. Program sets pin P1.31 as an ADC chanel 5 input to which we connect the potentiometer. Program then turns on an embedded LED on the LPC4088 QSB when the potentiometer's digital value exceeds the middle value.

Dependencies:   mbed

LPC4088-adc.h

Committer:
71GA
Date:
2015-05-02
Revision:
0:3b7f012600ec

File content as of revision 0:3b7f012600ec:

//register definitions for ADC peripheral

#define CR      (*((volatile unsigned int *) 0x40034000))
#define GDR     (*((volatile unsigned int *) 0x40034004))
#define INTEN   (*((volatile unsigned int *) 0x4003400C))

#define DR0     (*((volatile unsigned int *) 0x40034010))
#define DR1     (*((volatile unsigned int *) 0x40034014))
#define DR2     (*((volatile unsigned int *) 0x40034018))
#define DR3     (*((volatile unsigned int *) 0x4003401C))
#define DR4     (*((volatile unsigned int *) 0x40034020))
#define DR5     (*((volatile unsigned int *) 0x40034024))
#define DR6     (*((volatile unsigned int *) 0x40034028))
#define DR7     (*((volatile unsigned int *) 0x4003402C))

#define STAT    (*((volatile unsigned int *) 0x40034030))
#define TRM     (*((volatile unsigned int *) 0x40034034))