16F819 ICSP programming


Closed Thread
Results 1 to 16 of 16
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117

    Default 16F819 ICSP programming

    Hi people.

    I had a design with ICSP that used 16f628 and all work good.

    After uograding to F819 I am facing a strange problem. The new chip cannot be programmed with ICSP. I contacted my programmer manufacturer but could not find any solution. They suggested to connect PGM pin even if it is not used. Microchip does not mention any differencies in ICSP between the two chips.

    Any ideas welcome.

    Ioannis

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Ioannis,

    I>>After uograding to F819 I am facing a strange problem. The new chip cannot be programmed with ICSP. I contacted my programmer manufacturer but could not find any solution. They suggested to connect PGM pin even if it is not used. Microchip does not mention any differencies in ICSP between the two chips.

    Any ideas welcome.<<


    Chances are, what is happening, is the 819 has programmable clock speeds.. the default clock speed is (I think) 32K.... And your chip is running just perfect.... Only it is running so slow, you are not giving it enough time to let it do its job. <chuckle> Look under the FAQ, there is a thread on this very thing... You will have to set the internat OSC to 4Mhz to be equivalent to your chip that has a internal OSC of 4MHZ.

    Have fun!

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Dwayne point this thread

    http://www.picbasic.co.uk/forum/show...=&threadid=706

    i found this on Melabs web site some hints for some MCU
    http://www.melabs.com/support/mcu_hints.htm

    Since i've never use this PIC, the clock speed might be the cause but see this.
    http://www.melabs.com/support/icsp.htm

    the problem will happen also with PIC16F877. You have to connect PGM (in your case pin 9) to gnd when programming. There's some interference to low voltage PGM pin when programming in ICSP. When you program this device, is there any error reported by your programmer software???

    regards
    Last edited by mister_e; - 28th October 2004 at 00:09.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Dwayne,

    you was right. i just buy a load of these F819 to test your solution and the problem is really caused by OSCCON value unset at the program begining. PBP will assume OSCCON as 0 wich is mean 31.25Khz in datasheet.

    Ioannis see datasheet p 40 OSCCON Register settings for proper clock setting.


    Few settings:

    OSCCON = $70 ;8 MHZ
    OSCCON = $60 ;4 Mhz

    etc...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    Many thanks for the answers. But I cannot see the relations between ICSP (which involves RB6, RB7, MCLR\, Vcc and Gnd) and the clock of the OSCON. Though I will try to see what happens. With the F877 I never had any problem with the same configuration. It programs OK.

    Ioannis

  6. #6
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Steve,


    Steve>>you was right. i just buy a load of these F819 to test your solution and the problem is really caused by OSCCON value unset at the program begining. PBP will assume OSCCON as 0 wich is mean 31.25Khz in datasheet.<<

    I have a couple of these chips....I remembered programming one of them with a working "Blinky" binary count... And I waited...And I waited... And I almost gave up... I turned around, and out of the corner of my eye I saw a "Blink". I then started playing with my program and found the speed to be crawling. Scoped it, and my scope went to sleep waiting <g>

    Then I went to the Data sheet and played with the OSC to fix it all up <g>.

    Yeah, the chip was running... but I was turning gray waiting for it to do my job. <chuckle>

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Dwayne: but I was turning gray waiting for it to do my job
    well, it's like trying do anything in Assembly language Thanks to any compilers like PICBasic.

    Ioannis :Many thanks for the answers. But I cannot see the relations between ICSP (which involves RB6, RB7, MCLR\, Vcc and Gnd) and the clock of the OSCON. Though I will try to see what happens. With the F877 I never had any problem with the same configuration. It programs OK.
    Well in this specific F819 that mean absolutely nothing. Everything is in the program device setting. What i was thinking is the programming method before i test the F819.

    In many case, depending of your hardware or circuit design, you'll not be able to program this F877 PIC if PGM pin is not at least loaded with something. I've some pre-made F877 platform with an LCD on PORTB. In this case nothing happen 'cause PGM is on PORTB.3 wich is attach to LCD. This is what i was expecting for F819. But when i remove LCD from proto-board, PICstart,MPLAB return me errors. ALL are caused by interference with floating PGM pin.

    Sorry for my bad assumption on this thread. One day i'll be better !!!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Oscillator settings shouldn't have anything to do with in-circuit programming.

    Can you program the 819 in your programmers socket, but it fails when attempting to program in-circuit?

    A couple of things to check would be;

    Make sure you have solid connections with short wires from your programmers clock, data, Vpp, and ground connections to the 819 being programmed in-circuit. I keep mine under 5 inches.

    Power your circuit separately without attempting to supply power from your programmer to the board/circuit being programmed.

    Make sure you isolate, I,E, you have no circuit connections to your 819 programming clock & data pins like LED's, sensors, etc, during ic-circuit programming. Loads on PGC & PGD will definitely cause problems during ICSP attempts.

    I use a small switch to flip between ICSP & normal run modes on my 819 dev board, and I can program it all day long with the EPIC attached via a "short" 10-pin header/flat-ribbon cable.

    If you still have problems, write a simple LED blink routine, and be sure to set LVP "off", drop the 819 into your programmer socket, and burn it.

    @ DEVICE LVP_OFF, MCLR_OFF

    Make sure the LED blink routine is running as expected first, then see if you can program it in-circuit.

    You might want to also check your programmers software after loading your .HEX file before programming the 819 to make sure it's not over-ridding whatever embedded config fuse settings you have. Some programmer software uses the config fuse settings shown on-screen, and may ignore whatever you have embedded in your .hex file.

    Also, you might want to check to see if your programmer does an erase before programming.

    If I turn off the "Erase Before Programming" option in my EPIC software, then try ICSP on the 819, it fails every single time. I turn this option back on, and presto, works every time.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  9. #9
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Bruce,

    Bruce>>Oscillator settings shouldn't have anything to do with in-circuit programming.<<


    Yes Bruce, you are correct. Thanks for pointing this out.


    The reason why *I* answered in the OSC response, and the reason why Mister_e responded also, is because the Gentleman already seemed to take precautions of programming problems. Then when I saw he went from a 4 MHZ OSC to a 32k OSC, I remmebered how I *thought* my chip was burnt up <g>. then I realized the 32K OSC was defaulted... thus 128 times slower than a regular 4MHZ chip <g>. That is the equivalent of running Windows XP on a 4 GHZ machine and comparing it to a 32 MHZ machine. Most people would say your machine is "locked" up. <g>.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  10. #10
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Yeah -- that internal osc defaulting to 32kHz can definitely be a gotcha...;o]
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  11. #11
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    Bruce thanks for the tips.

    I used the same configuration but with F628 chip (in smd case) with no ICSP problems.

    Then I swiched to F819 and ... presto! No programming!

    There is no other difference in the circuit. Also try it with seperate power. No luck.

    The problem is that the chip (F819) is no recognised by the programmer. The Chip ID is read wrong. If I remember 0EEDh was expected and 04EDh was read or something.

    Ioannis

  12. #12
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Have you tried programming an 819 in your programmer socket, or does it only fail when attempting ICSP with the 819?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    Bruce, I have not been able to try programming on the programmer since they are SMD chips.

    But have tried to program the PCB on a friend's Microchip ICSP programmer and it did it OK. Others do not. I don't know what more does the Microchip system do but will investigate to it.

    Soon will have some DIP to try also.

    The strange thing is that with exactly the same hardware config F628 works OK but F819 does not.

    Ioannis

  14. #14
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I found the same thing when using a little 18-pin dev board I made. It worked fine with the 16F62x series, but didn't with the 819 until I turned ON "Erase Before Program" with the EPIC.

    Other than that, all I can think of is a problem with LVP. You might try grounding LVP on the 819 to see if that helps.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,117


    Did you find this post helpful? Yes | No

    Default

    The LVP is not directly grounded. I'll try to short it and see what happens.

    Thanks again
    Ioannis

  16. #16
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As i say couple reply above, for sure LVP pin may cause that(that's what i said F877 prob + link of melabs ICSP tips). Since i don't know wich programmer you using, also check for load on PGC & PGD pin. If there's anything on, remove it and post result.

    regards
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Data Programming Error at 0000
    By cpatnoi in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd May 2009, 03:37
  2. Problems programming
    By Lionheart in forum General
    Replies: 4
    Last Post: - 7th December 2008, 16:51
  3. Soic Icsp
    By earltyso in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th September 2008, 19:51
  4. Replies: 1
    Last Post: - 10th December 2007, 23:57
  5. ICSP Programming from a PDA
    By Ralph in forum Off Topic
    Replies: 2
    Last Post: - 11th November 2007, 22:22

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts