Adc Program
Adc Program
Adc Program
* Developed by
*--------------------------------------------------------------------
* Controller : LPC1768
* Project : ALS-SDA-ARMCTXM3-06
* the pin P1.31 is varied by varying the pot P1. Since ref
***********************************************************************/
#include<LPC17xx.h>
#include<stdio.h>
#include"AN_LCD.h"
int main(void)
unsigned int i;
float in_vtg;
SystemCoreClockUpdate();
lcd_init();
SystemCoreClockUpdate();
temp1 = 0x80;
lcd_com();
delay_lcd(800);
lcd_puts(&Msg3[0]);
temp1 = 0xC0;
lcd_com();
delay_lcd(800);
lcd_puts(&Msg4[0]);
while(1)
adc_temp = LPC_ADC->ADGDR;
adc_temp >>= 4;
adc_temp &= 0x00000FFF; //12 bit ADC
sprintf(dval,"%x",adc_temp);
for(i=0;i<2000;i++);
temp1 = 0x8A;
lcd_com();
delay_lcd(800);
lcd_puts(&vtg[0]);
temp1 = 0xCB;
lcd_com();
lcd_puts(&blank[0]);
temp1 = 0xCB;
lcd_com();
delay_lcd(800);
lcd_puts(&dval[0]);
for(i=0;i<200000;i++);
for(i=0;i<7;i++)
adc_temp = 0;
in_vtg = 0;