Hi Magu,
Paste the code below in the Windows editor "Notepad" and save the
file using the name mblink.bas. Save the file in the folder where you
have installed the demo of PicBasic Pro.
(The default is "C:\PBPDEMO\").
Code:
' File name: mblink.bas
' Target: 16f628A
' Compile the file from the command line: pbpdemo.exe -p16f628a mblink.bas
'
' +5V
' |
' _|_
' _\_/_ LED 1
' |
' RA4-----/\/\/\----+
' 300 ohm
'
@ device pic16f628A, hs_osc, lvp_off, mclr_off, pwrt_on, cpd_off
DEFINE OSC 10 ' 10 MHz crystal used.
CMCON = 7 ' Disable comparator, set PortA in digital mode.
OUTPUT PORTA.4 ' Set RA4 as output
loop: LOW PORTA.4 ' Turn on LED 1, the pin RA4 sinks current.
PAUSE 500 ' Delay for .5 seconds.
HIGH PORTA.4 ' Turn off LED 1, the pin RA4 floats, (RA4 open drain output).
PAUSE 500 ' Delay for .5 seconds.
GOTO loop ' Go back to loop and blink LED 1 forever.
END
Open a command shell window, change directory to C:\PBPDEMO and type:
pbpdemo.exe -p16f628a mblink.bas
This will compile your program and you will get the HEX file MBLINK.HEX.
Remove all the ICs from your board. With IC-Prog program the
PIC 16F628A with the file MBLINK.HEX. Once you have done that,
with IC-Prog VERIFY the chip. Once you are sure that the chip
is programmed OK, plug the PIC in the socket 1 and power up the
board. If everything is OK, you will see the LED 1 blink forever.

(Click to enlarge the picture).
Best regards,
Luciano
Bookmarks