annna
Member level 2
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..........................