Author Topic: Help!!! Why Can't I Program My PIC18F25K22 ID's ????(Solved)  (Read 13236 times)

0 Members and 1 Guest are viewing this topic.

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: Help!!! Why Can't I Program My PIC18F25K22 ID's ???? (Solved)
« Reply #50 on: June 07, 2015, 08:46:14 pm »
Thanks Amyk, but the situation of Vihh is just the opposite than conservative. The Pickit3 sets Vihh at 9.25 volts and this violates Vihh max of 9V with an over voltage of .25V.

I found some simple programming errors. I wasn't reading the MCU bytes correctly because I was setting the wrong values for TBLPTR, it was a matter of my code improperly adding a byte variable to the base instruction &HE0 (MOVLW) in setting of TBLPTR by using the mistaken:  DW = &HE0 + u : Call CID16

The correct code:

 DW = &HE00 + u : Call CID16 'Set Table Ptr Regs
 DW = &H6EF8: Call CID16 'assigns above u address value to TBLPTRU
I was also not setting the TBLPTRU,H,L to a modulus 64 =0 page boundary to start a fill of the 64 byte write buffer.
I was also dividing the .hex record start address by two  and so all main() code was written to the address/2.
My code was also word rather than byte oriented. |O


On the hardware side, my scope showed the problem immediately, once I started to look in the right place.

In the Pgm25K22 programming sub, at the very beginning I failed to enter programming mode properly before starting the programming sequence of commands.  By accident with a mouse editing screwup, I deleted a delay call so my code was raising Vihh  at the exact same time as the first  PClk lo to hi and there must be a 400 uSec delay after  Vpgm Lo-->Hi before any change in Pclk or Pdat.

I am glad that I found that all my MCU chips are undamaged and programming failure was just due to bigtime coding screwup.

I could see the Hex File did not match .lst file code addresses, so the programmed result was garbage, because I was not coding  to set the write buffer TBLPTR table  write addresses correctly and the .hex addresses were all set to addresses/2.
 

« Last Edit: June 16, 2015, 01:25:29 pm by SuzyC »
 

Offline Deathwish

  • Supporter
  • ****
  • Posts: 1424
  • Country: wales
Re: Help!!! Why Can't I Program My PIC18F25K22 ID's ????
« Reply #51 on: June 16, 2015, 11:33:38 am »
Think its only the Pickt3 that will program /debug that 18f25k22 series.

You can buy a bare bones pk3 from China for about GB £12 or a cased one for £20, boths cheaper than the 10 chips you bought.
http://www.ebay.co.uk/itm/Hot-PICkit3-PIC-KIT3-Debugger-Programmer-Emulator-Chip-Programmer-PIC-Controller-/271799867505?pt=LH_DefaultDomain_3&hash=item3f4888d871

Just to let you all know that this seller does indeed send these out complete in a case. I got mine today
Electrons are typically male, always looking for any hole to get into.
trying to strangle someone who talks out of their rectal cavity will fail, they can still breath.
God hates North Wales, he has put my home address on the blacklist of all couriers with instructions to divert all parcels.
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: Help!!! Why Can't I Program My PIC18F25K22 ID's ????
« Reply #52 on: June 16, 2015, 12:47:08 pm »
Thanks Deathwish, I may need to get one of these someday.  :-+
For now, I have gotten my DYI programmer of my own HW and SW design to work perfectly. ^-^
« Last Edit: June 16, 2015, 01:28:03 pm by SuzyC »
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2256
  • Country: ca
Re: Help!!! Why Can't I Program My PIC18F25K22 ID's ????
« Reply #53 on: June 19, 2015, 02:06:12 pm »
Thanks Deathwish, I may need to get one of these someday.  :-+
For now, I have gotten my DYI programmer of my own HW and SW design to work perfectly. ^-^
I too have a cheap PK3 clone and it works flawlessly. Keep in mind that the PK3 is not only a programmer, but an in-circuit debugger as well. Combine that with the fact that it supports basically all PIC devices of all Vcc ranges, and integrates into MPLABX (or not if you choose), and it is a great value.

One learns a lot from taking on a project like your PIC programmer, and when it is all done, the most valuable thing gained is that knowledge, not the end product. Now that you have that, your needs may be better served by the 'real thing' (or a clone of it!), at least some of the time.

I've never designed my own programmer but I wrote a really nice PIC disassembler. It even sorts out program memory pages and register banks, and resolves all SFR names and labels all functions and subroutines. I will never use it enough to get real value from my time and effort, but I learned a lot writing it.
 

Offline SuzyCTopic starter

  • Frequent Contributor
  • **
  • Posts: 792
Re: Help!!! Why Can't I Program My PIC18F25K22 ID's ????(Solved)
« Reply #54 on: June 19, 2015, 02:41:58 pm »
I strongly disagree, macboy

Thanks for your advertisement  for Microchip's fine products, but you've haven't at all sold me.

The instrument I've developed best fits my needs better than any other because I designed it to work that way, that I always have the ability to modify it  or repair it so easily, that is works so well, it is all  priceless. I am not in the chip programming business and even if was, I would need to purchase a minion of professional programming devices.
« Last Edit: June 19, 2015, 03:23:32 pm by SuzyC »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf