russman613
- 24th February 2006, 23:33
So, i am new to the whole PIC programming thing but think i have all the gear and set up to get going.
i am sure i am missing something very small in the category of DFU.
I am using the blinking led sample program from Melanie in this post: http://www.picbasic.co.uk/forum/showthread.php?t=3170&highlight=12f675
here is the code:
' PIC Defines
' -----------
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
' System Clock Options (Internal)
@ DEVICE pic12F675, WDT_ON
' Watchdog Timer
@ DEVICE pic12F675, PWRT_ON
' Power-On Timer
@ DEVICE pic12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic12F675, BOD_ON
' Brown-Out Detect
'
' Initialise
' ----------
TRISIO=%00001000
CMCON=%00000111
ANSEL=%00000000
'
' Hardware Defines
' ----------------
LED var GPIO.0
'
' Program Body
' ------------
Loop:
Toggle LED
Pause 500
Goto Loop
End
My problem is that the starting of the led blinking is erratic. usually, when i first put it in my test circuit it blinks as expected. if i cycle the power it will not come back on . if i fiddle with it or leave it, sometimes it will work again. if i leave it alone, after a few minutes, the led will turn on and stay on. it seems to work the first time every time after i reprogram it. when it does blink, it does seem to blink blink at the right frequency.
i am using the new melabs USB programmer, PicBasic Pro compiler 2.46 with MicroCode studio 2.3.0.0. Under compile and program options, i have Use MPASM unchecked.
the test circuit has a .1uf bypass capacitor connected to pin 1 and pin 8. the led is connected to pin 7 (gpio.0) vdd is on pin 1 and vss is on pin 8. all other pins are not connected to anything. pretty simple. it is powered via a LM2940CT-5.0 with the manufacturer specified cpacitors on either side, plus some bulk capacitors (since i eventually want to run an hbridge off the unregulated side of the same power supply).
Since my setup could not be any simpler, clearly I must be missing something. i have tried three different prototype breadboards.
thoughts? Suggestions?? insults???
thanks in advance.
russ
i am sure i am missing something very small in the category of DFU.
I am using the blinking led sample program from Melanie in this post: http://www.picbasic.co.uk/forum/showthread.php?t=3170&highlight=12f675
here is the code:
' PIC Defines
' -----------
@ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
' System Clock Options (Internal)
@ DEVICE pic12F675, WDT_ON
' Watchdog Timer
@ DEVICE pic12F675, PWRT_ON
' Power-On Timer
@ DEVICE pic12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE pic12F675, BOD_ON
' Brown-Out Detect
'
' Initialise
' ----------
TRISIO=%00001000
CMCON=%00000111
ANSEL=%00000000
'
' Hardware Defines
' ----------------
LED var GPIO.0
'
' Program Body
' ------------
Loop:
Toggle LED
Pause 500
Goto Loop
End
My problem is that the starting of the led blinking is erratic. usually, when i first put it in my test circuit it blinks as expected. if i cycle the power it will not come back on . if i fiddle with it or leave it, sometimes it will work again. if i leave it alone, after a few minutes, the led will turn on and stay on. it seems to work the first time every time after i reprogram it. when it does blink, it does seem to blink blink at the right frequency.
i am using the new melabs USB programmer, PicBasic Pro compiler 2.46 with MicroCode studio 2.3.0.0. Under compile and program options, i have Use MPASM unchecked.
the test circuit has a .1uf bypass capacitor connected to pin 1 and pin 8. the led is connected to pin 7 (gpio.0) vdd is on pin 1 and vss is on pin 8. all other pins are not connected to anything. pretty simple. it is powered via a LM2940CT-5.0 with the manufacturer specified cpacitors on either side, plus some bulk capacitors (since i eventually want to run an hbridge off the unregulated side of the same power supply).
Since my setup could not be any simpler, clearly I must be missing something. i have tried three different prototype breadboards.
thoughts? Suggestions?? insults???
thanks in advance.
russ