Microcontroller › PIC › About ADC programming error….
- This topic has 2 replies, 3 voices, and was last updated 9 years, 9 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
December 22, 2014 at 7:52 am #3364jarryParticipant
I’m using PIC18f4550 and for ADC programming I’m getting error as below please any onr help me
\ProjectsCompleted_projectsPIC18F4550 tasksADC with LDCADClcd.c:79:Error [1105] symbol ‘GO’ has not been defined..
MY CODE IS
// Program to depict working with inbuilt ADC of PIC18F4550 Microcontroller// This code uses Channel0 (zero) of PIC’s ADC Module// Configuration bits/* _CPUDIV_OSC1_PLL2_1L, // Divide clock by 2_FOSC_HS_1H, // Select High Speed (HS) oscillator_WDT_OFF_2H, // Watchdog Timer offMCLRE_ON_3H // Master Clear on*/#include<p18f4550.h>#define rs PORTAbits.RA0#define rw PORTAbits.RA1#define en PORTAbits.RA2#define lcdport LATBvoid lcd_ini();void lcdcmd(unsigned char);void lcddata(unsigned char);void adc_con(unsigned int);void adc_init();unsigned char data[20]=”ADC OUTPUT=”;unsigned int digital_out[10],avg_output=0,temp;unsigned int i=0;void Delay_ms(unsigned int dly){unsigned char i;for(;dly>0;dly–){for(i=250;i>0;i–);for(i=237;i>0;i–);}}void adc_init(){ADCON1=0x0E; // Make RA0/AN0 pin as analog pin (Other pins remain to be digital I/O)ADCON0=0x00; // Select Channel0 & ADC offADCON2=0x8A; // Left justified, 2TAD acquiciation time, Fosc/32 clock optionADCON0bits.ADON = 1; // Enable ADCADCON0bits.GO = 1;}void lcd_ini(){lcdcmd(0x38); // Configure the LCD in 8-bit mode, 2 line and 5×7 fontlcdcmd(0x0C); // Display On and Cursor Offlcdcmd(0x01); // Clear display screenlcdcmd(0x06); // Increment cursorlcdcmd(0x80); // Set cursor position to 1st line, 1st column}void main(void){TRISA=0x01; // Configure RA0 as input pinLATA=0;TRISB=0; // Configure Port B as output portLATB=0;TRISD=0;LATD=0;lcd_ini(); // LCD initializationwhile(data!=’