annna
Member level 2
- Joined
- Jun 17, 2010
- Messages
- 52
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- pak
- Activity points
- 1,682
Hi everyone,
I have recently started using PIC with C, but I am having some problems. I was trying to make a first test program that toggles portb every second. The simulation works fine but when I tried it in real world nothing happen. I am a using a JDM programmer and Hi Tech C compiler. Can anyone tell me where I am doing the mistake. Here's the code......
#include<htc.h>
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4000000
#endif
void main(void)
{
TRISB = 0;
while(1)
{
PORTB = 0xFF;
__delay_ms(1000);
PORTB = 0x00;
__delay_ms(1000);
}
}
waiting for your reply..........................
I have recently started using PIC with C, but I am having some problems. I was trying to make a first test program that toggles portb every second. The simulation works fine but when I tried it in real world nothing happen. I am a using a JDM programmer and Hi Tech C compiler. Can anyone tell me where I am doing the mistake. Here's the code......
#include<htc.h>
#ifndef _XTAL_FREQ
#define _XTAL_FREQ 4000000
#endif
void main(void)
{
TRISB = 0;
while(1)
{
PORTB = 0xFF;
__delay_ms(1000);
PORTB = 0x00;
__delay_ms(1000);
}
}
waiting for your reply..........................