Apr 11, 2011 #1 P panos_papajohn Member level 2 Joined Mar 18, 2011 Messages 46 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,288 Activity points 1,640 Hi everyone, I am using PIC3 kit to program a PIC18f1230. Code: #include <stdio.h> #include <delays.h> #pragma config OSC=HS, WDT=OFF, IESO=OFF, XINST=OFF void main (void) {TRISB=0; PORTB=0x00; //Delay10KTCYx(0); PORTB=0xFF; //Delay10KTCYx(0); while (1) ; } This is the code I wrote. When I connect a led to the portB nothing happens. Of course the current should be taken into account, but the thing is that when I measure the voltage on every pin of the portB I get 0 volts. Did i do something wrong? Thanks for the help Panos
Hi everyone, I am using PIC3 kit to program a PIC18f1230. Code: #include <stdio.h> #include <delays.h> #pragma config OSC=HS, WDT=OFF, IESO=OFF, XINST=OFF void main (void) {TRISB=0; PORTB=0x00; //Delay10KTCYx(0); PORTB=0xFF; //Delay10KTCYx(0); while (1) ; } This is the code I wrote. When I connect a led to the portB nothing happens. Of course the current should be taken into account, but the thing is that when I measure the voltage on every pin of the portB I get 0 volts. Did i do something wrong? Thanks for the help Panos
Apr 11, 2011 #2 R raco_rage Member level 3 Joined Mar 14, 2011 Messages 61 Helped 18 Reputation 36 Reaction score 18 Trophy points 1,288 Activity points 1,601 try to check PORTB output after removing PORTB = 0x00. Right now, it'll be going so fast in the while loop that you cannot measure it.
try to check PORTB output after removing PORTB = 0x00. Right now, it'll be going so fast in the while loop that you cannot measure it.
Apr 11, 2011 #3 P panos_papajohn Member level 2 Joined Mar 18, 2011 Messages 46 Helped 1 Reputation 2 Reaction score 1 Trophy points 1,288 Activity points 1,640 Thank you raco_rage