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-timer.h
- Committer:
- 71GA
- Date:
- 2015-05-02
- Revision:
- 0:3b7f012600ec
File content as of revision 0:3b7f012600ec:
//definicije registrov za periferijo TIMER //timer 0 /* #define IR (*((volatile unsigned int *) 0x40004000)) #define TCR (*((volatile unsigned int *) 0x40004004)) #define TC (*((volatile unsigned int *) 0x40004008)) #define PR (*((volatile unsigned int *) 0x4000400C)) #define PC (*((volatile unsigned int *) 0x40004010)) #define MCR (*((volatile unsigned int *) 0x40004014)) #define MR0 (*((volatile unsigned int *) 0x40004018)) #define MR1 (*((volatile unsigned int *) 0x4000401C)) #define MR2 (*((volatile unsigned int *) 0x40004020)) #define MR3 (*((volatile unsigned int *) 0x40004024)) #define CCR (*((volatile unsigned int *) 0x40004028)) #define CR0 (*((volatile unsigned int *) 0x4000402C)) #define CR1 (*((volatile unsigned int *) 0x40004030)) #define EMR (*((volatile unsigned int *) 0x4000403C)) #define CTCR (*((volatile unsigned int *) 0x40004070)) */ //timer 1 /* #define IR (*((volatile unsigned int *) 0x40008000)) #define TCR (*((volatile unsigned int *) 0x40008004)) #define TC (*((volatile unsigned int *) 0x40008008)) #define PR (*((volatile unsigned int *) 0x4000800C)) #define PC (*((volatile unsigned int *) 0x40008010)) #define MCR (*((volatile unsigned int *) 0x40008014)) #define MR0 (*((volatile unsigned int *) 0x40008018)) #define MR1 (*((volatile unsigned int *) 0x4000801C)) #define MR2 (*((volatile unsigned int *) 0x40008020)) #define MR3 (*((volatile unsigned int *) 0x40008024)) #define CCR (*((volatile unsigned int *) 0x40008028)) #define CR0 (*((volatile unsigned int *) 0x4000802C)) #define CR1 (*((volatile unsigned int *) 0x40008030)) #define EMR (*((volatile unsigned int *) 0x4000803C)) #define CTCR (*((volatile unsigned int *) 0x40008070)) */ //timer 2 #define IR (*((volatile unsigned int *) 0x40090000)) #define TCR (*((volatile unsigned int *) 0x40090004)) #define TC (*((volatile unsigned int *) 0x40090008)) #define PR (*((volatile unsigned int *) 0x4009000C)) #define PC (*((volatile unsigned int *) 0x40090010)) #define MCR (*((volatile unsigned int *) 0x40090014)) #define MR0 (*((volatile unsigned int *) 0x40090018)) #define MR1 (*((volatile unsigned int *) 0x4009001C)) #define MR2 (*((volatile unsigned int *) 0x40090020)) #define MR3 (*((volatile unsigned int *) 0x40090024)) #define CCR (*((volatile unsigned int *) 0x40090028)) #define CR0 (*((volatile unsigned int *) 0x4009002C)) #define CR1 (*((volatile unsigned int *) 0x40090030)) #define EMR (*((volatile unsigned int *) 0x4009003C)) #define CTCR (*((volatile unsigned int *) 0x40090070)) //timer 3 /* #define IR (*((volatile unsigned int *) 0x40094000)) #define TCR (*((volatile unsigned int *) 0x40094004)) #define TC (*((volatile unsigned int *) 0x40094008)) #define PR (*((volatile unsigned int *) 0x4009400C)) #define PC (*((volatile unsigned int *) 0x40094010)) #define MCR (*((volatile unsigned int *) 0x40094014)) #define MR0 (*((volatile unsigned int *) 0x40094018)) #define MR1 (*((volatile unsigned int *) 0x4009401C)) #define MR2 (*((volatile unsigned int *) 0x40094020)) #define MR3 (*((volatile unsigned int *) 0x40094024)) #define CCR (*((volatile unsigned int *) 0x40094028)) #define CR0 (*((volatile unsigned int *) 0x4009402C)) #define CR1 (*((volatile unsigned int *) 0x40094030)) #define EMR (*((volatile unsigned int *) 0x4009403C)) #define CTCR (*((volatile unsigned int *) 0x40094070)) */