If you copied the HEX and pasted it into notepad... probably why you had problems.
Now, the PICkit1 board has the LEDs in a matrix. So the coding is a little different than just HIGH this and LOW that.
Lesson #1
The PIC has three states a pin can be in.
OUTPUT HIGH
OUTPUT LOW
INPUT
Here is the code to light the first three LEDs on the PICkit1 on and off, in sequence.
The HEX is attached. Save it and re-name it taking the ".txt" off.
Code:'16F676 PICKIT1 TEST ' PORTA 1,2 4, AND 5 ARE THE LED PINS @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF ANSEL = %00000000 CMCON = %00000111 START: 'D0 HIGH TRISA = %11001111 PORTA = %00010000 PAUSE 500 'D1 HIGH TRISA = %11001111 PORTA = %00100000 PAUSE 500 'D2 HIGH TRISA = %11101011 PORTA = %00010000 PAUSE 500 GOTO START






Bookmarks