messcalitto 0 Posted February 23, 2005 Report Share Posted February 23, 2005 I wrote this code on SourceBoost 5.9.1 and BoostC 2.0.1 target PIC16F877 #include "system.h" void main(void) { trisa = 0xff; trisd = 0; adcon1 = 0x82; adcon0 = 0x41; while(1) { set_bit( adcon0, GO ); while ((adcon0 & GO) == GO); portd = adresl; delay_ms(5); }; } it works fine. On debuger I configured Variable PSU -> RA0 as source of analog signal and LED Block -> PORTD as indicator to view result. It works fine. I wrote simular code for target PIC16F77 #include "system.h" void main(void) { trisa = 0xff; trisd = 0; adcon1 = 0x02; adcon0 = 0x41; while(1) { set_bit( adcon0, GO ); while ((adcon0 & GO) == GO); portd = adres; delay_ms(5); }; } now LED Block on PORTD doesn't indicate anything. Is this a some bug of debuger or there is some thing wrong in my code? Quote Link to post Share on other sites
Dave 0 Posted February 23, 2005 Report Share Posted February 23, 2005 messcalitto, The simulator doesn't support simulation of the ADC on the PIC16F77 Regards Dave Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.