ruben91
Junior Member level 3
- Joined
- Nov 17, 2014
- Messages
- 29
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 209
i am new to pic18f1330, i have written a code to test that the pic18f1330 works fine, but i can't get it work even for simple led on/off coding, please help me regarding this. I have attacted th code together with the connection of my pic. scared it was the wrong part..thank you
Code:
#include <p18f1330.h>
#pragma config OSC=INTIO2
#pragma config WDT = OFF
#pragma config DEBUG=ON
void main ()
{
TRISB=1; // switch
TRISA=0; // LED
while(1)
{
if(PORTBbits.RB1==0)
PORTHbits.RA0=1;// light on
else
PORTAbits.RA0=0;// light off
}
}