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
 
Thread Tools Display Modes
Old 6th January 2007, 09:38 PM   (permalink)
Default Configuration Bits (Nigel's tutorials and Inchworm)

I'm working through some of Nigel's tutorials, and trying to use the Inchworm ICD2 to program the 16F628A devices. However, Nigel's tutorials suggest using:
__config 0x3D18

I think that will cause problems with the Inchworm because of _MCLR and setting the internal oscillator. Am I correct?

I tried setting it to:

__Config 0x3D38

It programmed once correctly, but now it seems totally broken. Reprogramming attempts give me:
ICD0161: Verify failed (MemType = Program, Address = 0x7, Expected Val = 0x1683, Val Read = 0x1003)
ICD0275: Programming failed.

Did I blow these units? Any suggestion for the proper configuration bits here?

This is pretty tricky for a newcomer to try to use Nigel's lessons and an Inchworm programmer. Maybe I should've stuck to an easier programmer for my first try at this...

-LP
lpinkai is offline  
Reply With Quote
Old 6th January 2007, 11:00 PM   (permalink)
Default

Quote:
I tried setting it to:
__Config 0x3D38
That's the way it should be done.
Quote:
It programmed once correctly, but now it seems totally broken. Reprogramming attempts give me
Are you trying to program it "in circuit"? The problem with this is that Nigels Tuts are designed for a programmer using pull-up resistors where as the InchWorm is designed with pull-down resistors on the target clock/data lines. You need to isolate these lines from Nigels hardware for the ICD to work.
__________________
--- The days of the digital watch are numbered. ---
kchriste is offline  
Reply With Quote
Old 7th January 2007, 01:41 AM   (permalink)
Default Continued Reprogramming Probs...

I think I see what you're saying about pull-downs and pull-ups (and yes, I was trying to program in-circuit).

However, even just trying to program the devices alone again are giving me problems. I'm getting:

ICD0161: Verify failed (MemType = Program, Address = 0x7, Expected Val = 0x1683, Val Read = 0x1003)
ICD0275: Programming failed.

Seems that I was able to write to these once, but now I'm having problems. Any chance the device is at fault? The 16F628A is flash, right? Should be programmable multiple times? Thoughts?

-LP
lpinkai is offline  
Reply With Quote
Old 7th January 2007, 09:31 AM   (permalink)
Default

I would have thought the PIC being faulty is EXTREMELY unlikely, more likely is a problem with the ICSP - which my tutorials boards were never designed to do. What changes have you made to the board?.

You might consider using the 16F876 board?, and I've got a circuit for that modified for InchWorm.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Reply With Quote
Old 7th January 2007, 02:10 PM   (permalink)
Default Programming Circuit...

Nigel: Thanks for the comment. Made me go back and double check things and I think I found the problem (though I still have some questions). My programming circuit was incorrect. I used a diode/resistor between VPP/GND, not between VPP/VDD. It worked for a few programs, but now I think the parts are dead. Even hooking it in the correct configuration wasn't able to bring them back to life. Thoughts anyone?

Additionally, regarding Inchworm and your projects: Other than the configuration bits, I'm not sure what else is different (and why it shouldn't work). My configuration is the part on a project board, with 5 signals (VSS/VDD/VPP/PGD/PGC) coming from Inchworm. I've got a diode/resistor between VPP/VDD for programming. Additionally, I simply wired 4 1Khm: resistors inline w/ LEDs from PortB[0:3]. Should be able to emulate parts of your Lesson1, while also letting it be programmed by Inchworm, no? Not sure I understand why this simple configuration (other than the MCLR bit setting in your suggested __config configuration), wouldn't work. Thoughts?

-LP
lpinkai is offline  
Reply With Quote
Old 23rd January 2007, 05:20 PM   (permalink)
Default

Sorry to dig up an old thread but I've just tried Nigel's blink a LED program and I also get the same errors you got with a inchworm. If I use __CONFIG 0x3F34 it programs fine.

I've done some fiddeling with the bits and it comes down to setting bit5 to 0 causes it to fail.

bit 5: MCLRE: RA5/MCLR pin function select
1 = RA5/MCLR pin function is MCLR
0 = RA5/MCLR pin function is digital Input, MCLR internally tied to VDD
gregmcc is offline  
Reply With Quote
Old 23rd January 2007, 05:31 PM   (permalink)
Default

That's right, InchWorm works by controlling MCLR, if MCLR is disabled in the config fuses you won't be able to program it after the first time - you require a programmer that switches the +5V rail, so you can take control of MCLR before the PIC starts running.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Reply With Quote
Old 23rd January 2007, 05:38 PM   (permalink)
Default

Thanks for clearing it up. I've always wondered what all those config bits do
gregmcc is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 01:38 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.