Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools Display Modes
Old 2nd December 2008, 04:40 AM   #1 (permalink)
Default PIC16F690 code problems

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
bigfarmerdave is offline  
Old 2nd December 2008, 04:47 AM   #2 (permalink)
Default

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?
__________________
Superman returns..

Last edited by bananasiong; 2nd December 2008 at 04:47 AM.
bananasiong is online now  
Old 2nd December 2008, 05:07 AM   #3 (permalink)
Default 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?
Attached Thumbnails
PIC16F690 code problems-pic-16f690.jpg  
bigfarmerdave is offline  
Old 2nd December 2008, 05:52 AM   #4 (permalink)
Default

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?
__________________
Superman returns..

Last edited by bananasiong; 2nd December 2008 at 05:54 AM.
bananasiong is online now  
Old 2nd December 2008, 06:01 AM   #5 (permalink)
Default

Quote:
Originally Posted by bananasiong View Post
What are the configuration settings?
YES! Is the WDT disabled?
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 2nd December 2008, 02:46 PM   #6 (permalink)
Default

Quote:
Originally Posted by bigfarmerdave View Post
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 by nickelflippr; 2nd December 2008 at 02:52 PM.
nickelflippr is offline  
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Title Starter Forum Replies Latest
code problems for 4x4 keypad darsin General Electronics Chat 27 16th July 2008 06:20 AM
OLED LCD Code Problems freeskier89 Micro Controllers 0 4th May 2007 04:47 AM
Input Counter Pic16F84A (Code problems) loco Micro Controllers 4 26th September 2006 01:19 PM
Work ID reader Track 2 problems with pic code. Need help! egg0900 Micro Controllers 2 19th April 2004 06:58 AM
12C508 problems: Verify failed at code address 0000h ! faz666 Micro Controllers 4 29th July 2003 12:13 PM



All times are GMT. The time now is 02:17 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker