Hi Steve,
Can you please review the code below?
The code will be compiled with the demo version of PicBasic Pro.
We need this code in order to test the Odyssey II board.
I hope Ithaca is not too far away!
Thank you!
Best regards,
Odysseus (Ulysses) Luciano
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 ' ' 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
This has to work. But i would add the Configuration fuse line at the top.
I hope the Demo Allow that...
Code:<font color="#008000">' File name: mblink.bas ' Target: 16f628A ' Compile the file from the command line: pbpdemo.exe -p16f628a mblink.bas ' ' ' +5V ' | ' _|_ ' _\_/_ LED 1 ' | ' RA4-----/\/\/\----+ ' 300 ohm ' ' </font><font color="#000080">@ device pic16f628A, hs_osc, lvp_off, mclr_off, pwrt_on, cpd_off DEFINE </font>OSC 10 <font color="#008000">' 10 MHz crystal used. </font>CMCON = 7 <font color="#008000">' Disable comparator, set PortA in digital mode. </font><font color="#000080">OUTPUT </font>PORTA.4 <font color="#008000">' Set RA4 as output </font>loop: <font color="#000080">LOW </font>PORTA.4 <font color="#008000">' Turn on LED 1, the pin RA4 sinks current. </font><font color="#000080">PAUSE </font>500 <font color="#008000">' Delay for .5 seconds. </font><font color="#000080">HIGH </font>PORTA.4 <font color="#008000">' Turn off LED 1, the pin RA4 floats, (RA4 open drain output). </font><font color="#000080">PAUSE </font>500 <font color="#008000">' Delay for .5 seconds. </font><font color="#000080">GOTO </font>loop <font color="#008000">' Go back to loop and blink LED 1 forever. </font><font color="#000080">END </font>
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve,
Yes it does and IC-Prog 1.05E recognizes the configuration word.
Thank you!
Best regards,
Luciano
Good news!
Bienvenue Luciano, bonne chance![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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
Last edited by Luciano; - 19th June 2007 at 11:19.
Bookmarks