Jump to content
Sign in to follow this  
messcalitto

Debuger Error On Pic16f77

Recommended Posts

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?

Share this post


Link to post
Share on other sites

messcalitto,

 

The simulator doesn't support simulation of the ADC on the PIC16F77 :(

 

Regards

Dave

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...