clarence501
Junior Member level 3
- Joined
- Jan 24, 2011
- Messages
- 26
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Philippines
- Activity points
- 1,463
Hi Guys, can someone help me solve the problem that i have with this program? I can't run the simulation with it and I wonder what's wrong with it.
#include<pic.h>
int tenbit = 0;
void initialize(void);
main()
{
TRISE = 0x4;
ADCON0 = 0xB9;
ADCON1 = 0x80;
}
void initialize(void)
{
ADGO = 1;
while(ADGO)
{}
tenbit = ((ADRESH*256)+ADRESL);
if (tenbit>358)
{
PORTD = 0x00;
}
else
{
PORTD = 0x20;
}
}
These are the links to the ISIS model that I made:
Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting
https://obrazki.elektroda.pl/89_1297387134.jpg
I used RE2 as the analog input and my output is RD5.
#include<pic.h>
int tenbit = 0;
void initialize(void);
main()
{
TRISE = 0x4;
ADCON0 = 0xB9;
ADCON1 = 0x80;
}
void initialize(void)
{
ADGO = 1;
while(ADGO)
{}
tenbit = ((ADRESH*256)+ADRESL);
if (tenbit>358)
{
PORTD = 0x00;
}
else
{
PORTD = 0x20;
}
}
These are the links to the ISIS model that I made:
Image - TinyPic - Free Image Hosting, Photo Sharing & Video Hosting
https://obrazki.elektroda.pl/89_1297387134.jpg
I used RE2 as the analog input and my output is RD5.