Good news!
Bienvenue Luciano, bonne chance![]()
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.
The led doesen`t blink coreclty. It toggle, then stay lit 3 sec, blink again and so on. Maybe the pic is not good or the crystal.?
Hi Magu,
This the reason why we are testing with this LED 1 blink program.
With this program you can verify if the PIC and its 10 MHz crystal oscillator work.
Try that: (In order)
- On the socket of IC1 solder a 100nF capacitor between the pin 14 (VDD) and pin 5 (GND).
(You should already have one close to the PIC, solder a second one on the above pins).
- Test if the LED 1 blinks.
- Replace the two 22pF capacitors.
- Test if the LED 1 blinks.
- Replace the 10 MHz crystal.
- Test if the LED 1 blinks.
- Replace the PIC. (Program a new PIC with MBLINK.HEX).
- Test if the LED 1 blinks.
- Use a different +5V power supply. (Make one with a voltage regulator 7805).
- Test if the LED 1 blinks.
* * *
When you program the PIC with the program IC Prog follow the steps visible in picture below:
Do not modify the fuses which are automatically set by the file MBLINK.HEX.
The PIC is programmed OK only if the VERIFY step is successful!
Best regards,
Luciano
I made o small board showd in the picture attach and it works fine but the led stay lit. doesen`t blink foverer. And the led with the res doese`nt need to be conneted to Ra3 ? . I can`t find the datasheet for the crystal....
Last edited by magu; - 19th June 2007 at 20:05.
Hi Magu,
This circuit will work with our program MBLINK.BAS.
Please seek help locally, find a PIC expert in your country willing to help you.
Good luck!
Best regards,
Luciano
Bookmarks