Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F690 code problems

Status
Not open for further replies.

bigfarmerdave

New Member
I'm just starting with the PIC micros so am learning as I go. I'm using the PICkit2 to program 16F690 micro that came on the PICkit 2 Low Count Demo board. I'm using MicroCode Studio to write the code and the PICkit 2 programmer software to load the hex file into the 16F690. I'm following the online directions for the first program which is supposed to make an LED blink on and off. All that happens is that the first LED, which correlates to C.0, blinks twice very briefly. I can change it to C.0 to C.1 and then the second LED blinks twice. So I can see that the correct LED is blinking but why does it blink twice and stop. I can take the loop & goto loop out and it will still blink twice very quickly. I can change the pause times and it still has no effect on how long the LED stays on and off. What am I doing wrong? Also, does anyone know of a schematic of the PICkit 2 Low Pin Demo board? There is a PDF of the top layer of traces but a similar picture of the bottom layer of traces would be helpful as well. I should note that I do not have an external power supply hooked up to the board but rather it is getting its power through the PICkit 2 programmer which is hooked up to my computer via USB connection. The code is as follows....

TRISC = %00000000 'Sets port C to all outputs

loop:

High PORTC.0 ' Turn on LED
Pause 500 ' Delay for .5 seconds

Low PORTC.0 ' Turn off LED
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever
End
 
Hi,
How's the connection of the PIC? MCLR? And do you have decoupling capacitor (100 nF across vdd and vss)?
What about the configuration settings?
 
Last edited:
Here is the schematic of the PICkit 2 demo board

The cap is already on there. I assume that MCLR is being taken care of by the PICkit 2 programmer?
 

Attachments

  • PIC 16F690.JPG
    PIC 16F690.JPG
    122.6 KB · Views: 752
Hi,
MCLR is taken care by the programmer for only programming with supplying Vpp, not while executing the program. Is JP5 shorted? Try to short JP5 after programming with PICkit2. What are the configuration settings?
 
Last edited:
Also, does anyone know of a schematic of the PICkit 2 Low Pin Demo board?
When the Pickit2 program is opened, check the help tab, where there is a LPC demo board guide pdf link. Why they couldn't put the pinouts for the socket/header (on the solder mask) is beyond me, even if it was on the underside of the board.

EDIT: Well now that I'm signed in, I see you found it. This happens to me when first cup of coffee has not propped open my eyes.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top