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

Committer:
71GA
Date:
Sat May 02 17:33:44 2015 +0000
Revision:
0:3b7f012600ec
This is the first commit of this program.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
71GA 0:3b7f012600ec 1 //definicije registrov za periferijo TIMER
71GA 0:3b7f012600ec 2
71GA 0:3b7f012600ec 3 //timer 0
71GA 0:3b7f012600ec 4 /*
71GA 0:3b7f012600ec 5 #define IR (*((volatile unsigned int *) 0x40004000))
71GA 0:3b7f012600ec 6 #define TCR (*((volatile unsigned int *) 0x40004004))
71GA 0:3b7f012600ec 7 #define TC (*((volatile unsigned int *) 0x40004008))
71GA 0:3b7f012600ec 8 #define PR (*((volatile unsigned int *) 0x4000400C))
71GA 0:3b7f012600ec 9 #define PC (*((volatile unsigned int *) 0x40004010))
71GA 0:3b7f012600ec 10 #define MCR (*((volatile unsigned int *) 0x40004014))
71GA 0:3b7f012600ec 11 #define MR0 (*((volatile unsigned int *) 0x40004018))
71GA 0:3b7f012600ec 12 #define MR1 (*((volatile unsigned int *) 0x4000401C))
71GA 0:3b7f012600ec 13 #define MR2 (*((volatile unsigned int *) 0x40004020))
71GA 0:3b7f012600ec 14 #define MR3 (*((volatile unsigned int *) 0x40004024))
71GA 0:3b7f012600ec 15 #define CCR (*((volatile unsigned int *) 0x40004028))
71GA 0:3b7f012600ec 16 #define CR0 (*((volatile unsigned int *) 0x4000402C))
71GA 0:3b7f012600ec 17 #define CR1 (*((volatile unsigned int *) 0x40004030))
71GA 0:3b7f012600ec 18 #define EMR (*((volatile unsigned int *) 0x4000403C))
71GA 0:3b7f012600ec 19 #define CTCR (*((volatile unsigned int *) 0x40004070))
71GA 0:3b7f012600ec 20 */
71GA 0:3b7f012600ec 21
71GA 0:3b7f012600ec 22 //timer 1
71GA 0:3b7f012600ec 23 /*
71GA 0:3b7f012600ec 24 #define IR (*((volatile unsigned int *) 0x40008000))
71GA 0:3b7f012600ec 25 #define TCR (*((volatile unsigned int *) 0x40008004))
71GA 0:3b7f012600ec 26 #define TC (*((volatile unsigned int *) 0x40008008))
71GA 0:3b7f012600ec 27 #define PR (*((volatile unsigned int *) 0x4000800C))
71GA 0:3b7f012600ec 28 #define PC (*((volatile unsigned int *) 0x40008010))
71GA 0:3b7f012600ec 29 #define MCR (*((volatile unsigned int *) 0x40008014))
71GA 0:3b7f012600ec 30 #define MR0 (*((volatile unsigned int *) 0x40008018))
71GA 0:3b7f012600ec 31 #define MR1 (*((volatile unsigned int *) 0x4000801C))
71GA 0:3b7f012600ec 32 #define MR2 (*((volatile unsigned int *) 0x40008020))
71GA 0:3b7f012600ec 33 #define MR3 (*((volatile unsigned int *) 0x40008024))
71GA 0:3b7f012600ec 34 #define CCR (*((volatile unsigned int *) 0x40008028))
71GA 0:3b7f012600ec 35 #define CR0 (*((volatile unsigned int *) 0x4000802C))
71GA 0:3b7f012600ec 36 #define CR1 (*((volatile unsigned int *) 0x40008030))
71GA 0:3b7f012600ec 37 #define EMR (*((volatile unsigned int *) 0x4000803C))
71GA 0:3b7f012600ec 38 #define CTCR (*((volatile unsigned int *) 0x40008070))
71GA 0:3b7f012600ec 39 */
71GA 0:3b7f012600ec 40
71GA 0:3b7f012600ec 41 //timer 2
71GA 0:3b7f012600ec 42 #define IR (*((volatile unsigned int *) 0x40090000))
71GA 0:3b7f012600ec 43 #define TCR (*((volatile unsigned int *) 0x40090004))
71GA 0:3b7f012600ec 44 #define TC (*((volatile unsigned int *) 0x40090008))
71GA 0:3b7f012600ec 45 #define PR (*((volatile unsigned int *) 0x4009000C))
71GA 0:3b7f012600ec 46 #define PC (*((volatile unsigned int *) 0x40090010))
71GA 0:3b7f012600ec 47 #define MCR (*((volatile unsigned int *) 0x40090014))
71GA 0:3b7f012600ec 48 #define MR0 (*((volatile unsigned int *) 0x40090018))
71GA 0:3b7f012600ec 49 #define MR1 (*((volatile unsigned int *) 0x4009001C))
71GA 0:3b7f012600ec 50 #define MR2 (*((volatile unsigned int *) 0x40090020))
71GA 0:3b7f012600ec 51 #define MR3 (*((volatile unsigned int *) 0x40090024))
71GA 0:3b7f012600ec 52 #define CCR (*((volatile unsigned int *) 0x40090028))
71GA 0:3b7f012600ec 53 #define CR0 (*((volatile unsigned int *) 0x4009002C))
71GA 0:3b7f012600ec 54 #define CR1 (*((volatile unsigned int *) 0x40090030))
71GA 0:3b7f012600ec 55 #define EMR (*((volatile unsigned int *) 0x4009003C))
71GA 0:3b7f012600ec 56 #define CTCR (*((volatile unsigned int *) 0x40090070))
71GA 0:3b7f012600ec 57
71GA 0:3b7f012600ec 58
71GA 0:3b7f012600ec 59 //timer 3
71GA 0:3b7f012600ec 60 /*
71GA 0:3b7f012600ec 61 #define IR (*((volatile unsigned int *) 0x40094000))
71GA 0:3b7f012600ec 62 #define TCR (*((volatile unsigned int *) 0x40094004))
71GA 0:3b7f012600ec 63 #define TC (*((volatile unsigned int *) 0x40094008))
71GA 0:3b7f012600ec 64 #define PR (*((volatile unsigned int *) 0x4009400C))
71GA 0:3b7f012600ec 65 #define PC (*((volatile unsigned int *) 0x40094010))
71GA 0:3b7f012600ec 66 #define MCR (*((volatile unsigned int *) 0x40094014))
71GA 0:3b7f012600ec 67 #define MR0 (*((volatile unsigned int *) 0x40094018))
71GA 0:3b7f012600ec 68 #define MR1 (*((volatile unsigned int *) 0x4009401C))
71GA 0:3b7f012600ec 69 #define MR2 (*((volatile unsigned int *) 0x40094020))
71GA 0:3b7f012600ec 70 #define MR3 (*((volatile unsigned int *) 0x40094024))
71GA 0:3b7f012600ec 71 #define CCR (*((volatile unsigned int *) 0x40094028))
71GA 0:3b7f012600ec 72 #define CR0 (*((volatile unsigned int *) 0x4009402C))
71GA 0:3b7f012600ec 73 #define CR1 (*((volatile unsigned int *) 0x40094030))
71GA 0:3b7f012600ec 74 #define EMR (*((volatile unsigned int *) 0x4009403C))
71GA 0:3b7f012600ec 75 #define CTCR (*((volatile unsigned int *) 0x40094070))
71GA 0:3b7f012600ec 76 */