![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I've build a LCD clock using the schematic attached. The first time I program it using a Inchworm everything programs fine. If I recompile (mplab) and want to reprogram the PIC I keep getting errors. (verification failures) I've done some fiddling and its to do with the PGM pin being connected to the LCD - if I disconnect the LCD it programs fine. While this solution is ok I would like to program without disconnecting the pin all the time. I've tried a 10k resistor between the PIC pin10 and the LCD but no luck. Whats the trick here to get it working? | |
| |
| | (permalink) |
| Is your schematic complete? Add a 0.1uf cap across pins 5 & 14. PGM can be disabled with a __CONFIG setting. _LVP_OFF also you may need to add _MCLR_OFF since you have no pullup on the MCLR pin. | |
| |
| | (permalink) |
| Bill, The schematic is not 100% (I got it and the.hex file from http://www.josepino.com/pic_projects...?lcd_clock.jps) - I'm powering it from a stable 5V power supply and from the MCLR pin I have a diode and resistor to 5V (as in the inchworm hello world project) | |
| |
| | (permalink) |
| Anyone got any ideas on this one? | |
| |
| | (permalink) |
| Add the 0.1uf cap, it is important. Also those 1 line LCDs can be tricky, here's an L/C meter with the same display and PIC16F84 (there is code for the 16F628 on the site too) Jumper LK3 is for poorly behaved displays, the 10K pot is a much better solution than the 1K resistor. http://ironbark.bendigo.latrobe.edu.au/~rice/lc/ ![]() | |
| |
| | (permalink) |
| Thanks - I'll give it a go tonight and let you know the outcome. | |
| |
| | (permalink) |
| I've added the cap and the 10k pot - made no difference. The problem is not with the LCD - once programmed everything works 100%. Its when I have to reprogram the PIC in circuit that I need to disconnect pin 10 on the PIC. I'm looking for a way to not have to disconnect the pin every time I want to reprogram it. | |
| |
| | (permalink) |
| hi Greg >> While this solution is ok I would like to program without disconnecting the pin all the time. I've tried a 10k resistor between the PIC pin10 and the LCD but no luck. Whats the trick here to get it working? The simplest way would be to install a 0.1inch pitch jumper, that would save desoldering. I am not aware of any low cost component way of doing it.
__________________ Eric "Good enough is Perfect" PIC tutorials: Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ Last edited by ericgibbs; 7th July 2008 at 12:22 PM. | |
| |
| | (permalink) |
| Thanks - I'll do that. I thought there might be some magical way to do it | |
| |
| | (permalink) |
| If you turn off LVP in the config then there should be no way that the level on B4 should make any difference. Can you post the source file? Or even the hex file. Mike. Edit, you don't explain how you have your ICD2 connected. How are B6,7 connected? Have you tried a 10K resistor from the Enable line of the LCD to gnd? Last edited by Pommie; 29th September 2007 at 01:29 PM. | |
| |
| | (permalink) |
| Pommie - the LVP config bit is turned off. I've uploaded the source file. The original .hex file can be found at http://www.josepino.com/pic_projects...ock/jp6285.hex Edit: I've just tried a 10k resistor on the enable pin - doesnt make any difference. Here's a pic on my ICD2 wiring (its from Bill's hello world project) Last edited by gregmcc; 29th September 2007 at 01:50 PM. | |
| |
| | (permalink) |
| When I am using B6,7 in the main circuit I have 1K resistors in the lines from ICD2 to pic. In this circuit I would also put a 10K resistor from the enable pin (RA1) on the LCD to Gnd, this ensures that the LCD cannot become active and interfere with B6,7. Mike. | |
| |
| | (permalink) |
| No such luck - I put the 10k to ground and the 1k resistors between the pic and icd2. I've even tried to short lcd enable to ground - it still refuses to be programmed while PGM is connected to the LCD. | |
| |
| | (permalink) |
| The ICD2 (and Inchworm) both have 4.7K resistors to GND on the PGC & PGD pins. As long as the __CONFIG _LVP_OFF is there PGM should make zero difference. A HVP programmer will ignore the LVP setting and pin and read/write in HVP mode. PS how did you get MPLAB to assemble it? There are three very old commands that require modification before it will assemble. The assembler you're using might not set the fuses correctly in the hex file. Did the "hello world" program work for you? edit: ahh it's a disassembly of the hex file. Are you using a 16F628 or 16F628A? Last edited by blueroomelectronics; 29th September 2007 at 03:23 PM. | |
| |
| | (permalink) |
| I used mplab (latest version) and it assembled here fine. The hello world project works 100% as well - I can reprogram it till I'm blue in the face and it works everytime. What are the 3 old commands your mplab is complaining about? Edit: Yip - its a dissasembly of the hex file. I'm going through the source to try and understand (and teach myself) exactly what is going on. I'm using the 16F628 | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| LCD Troubles | Kyle-s4h | Micro Controllers | 13 | 11th September 2007 01:30 PM |
| Error programming 16F628 | gregmcc | Micro Controllers | 67 | 28th August 2005 09:17 AM |
| 16f628a programming only got 16f628 support will it work? | lompa | Micro Controllers | 6 | 18th December 2004 06:51 PM |
| 16f628 programming | develop | Micro Controllers | 0 | 1st January 2004 01:52 PM |
| Programming the 16F628 | rewguy | Micro Controllers | 4 | 30th October 2003 09:17 AM |