Author Topic: PIC18F6620 asking for advice  (Read 1796 times)

0 Members and 1 Guest are viewing this topic.

Offline BerserkTopic starter

  • Contributor
  • Posts: 13
  • Country: ru
PIC18F6620 asking for advice
« on: October 15, 2017, 08:04:57 am »
Hello everyone, I want to ask you for advice about sending firmware to PIC18F6620 microchip.

I am zero at programming microcontrollers, sorry, please help me if you can.

I have some diagnostic module on PIC18F6620, after attempt to update firmware on that module via diagnostic software something happened and module has stuck.

How can i reflash that chip? Do i need programmer like pickit3? Module board has 2 interface chips: com st232c, usb-com ft232rl

FT_PROG can see their chip *FT232R USB UART* but it's all
MPLAB IPE asking for programmer
« Last Edit: October 21, 2017, 03:25:14 pm by Berserk »
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: PIC18F6620 asking for advice
« Reply #1 on: October 15, 2017, 10:07:09 pm »
That RJ-11 socket at the top right of the picture looks to be connected directly to PGM and PGC lines used for programming.

How did you attempt to update the firmware?  There could be a boot-loader on the MCU which means you can flash it via USB or serial, but there is no real standard - it will be a custom job, possibly via the diagnostic software (how does it connect to that?).

It also depends on what file you have for flashing.  A plain *.hex file that contains the config bits as well can be flashed directly to the MCU via that RJ-11 port, using a PIC programmer - most likely a PIC kit 3 as it is the cheapest, along with a 6-pin to RJ-11 adapter.  But... if you update the firmware from the diagnostic software then it is entirely possible the file you have is specific for that bootloader - again, a custom file.

Edit: just checked the hex, I cannot see the ID byte location (200000h apparently, found here: http://ww1.microchip.com/downloads/en/DeviceDoc/39583c.pdf ) or any config words.  So it looks like a hex file for a bootloader but I could be wrong!  Normally bootloaders require an input to tell it to start reading in the new file, like a button, but often it checks first thing out of reset.  If it normally connects to a PC via USB, it could be theres a line between the FT232 and the PIC that is toggled when updating the firmware.  In that case, you should still be able to flash it via the diagnostic software.
« Last Edit: October 15, 2017, 10:18:25 pm by Buriedcode »
 
The following users thanked this post: Berserk

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: PIC18F6620 asking for advice
« Reply #2 on: October 15, 2017, 10:25:56 pm »
That's not a hex file, its a binary dump.  However it does seem to start with opcodes that are plausible for a PIC18 reset and interrupt vectors.

It *MAY* be possible to convert it back to an IntelHEX format file as required by Microchip's programming tools, and fix it up with parts of a hex file read from the device to provide CONFIG bit settings and any memory regions that aren't included in the dump, but it would be a *LOT* of work to do so.

OTOH the device may be read protected and in that case although you should be able to recover the CONFIG settings, any bootloader present in high memory will be missing and the firmware will probably crash on powerup.
 
The following users thanked this post: Berserk

Offline BerserkTopic starter

  • Contributor
  • Posts: 13
  • Country: ru
Re: PIC18F6620 asking for advice
« Reply #3 on: October 16, 2017, 07:05:13 pm »
How can i convert .pic to .hex correctly?

Attachment: saved config of corrupt device
« Last Edit: October 16, 2017, 07:13:31 pm by Berserk »
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1611
  • Country: gb
Re: PIC18F6620 asking for advice
« Reply #4 on: October 16, 2017, 09:20:23 pm »
Well, that may not be the best option.  We don't know what software you used to update the firmware, how you connect this board to a PC or workstation, how the firmware is provided (downloaded from a site with instructions? handed to you on a USB drive?) etc..

There is a standard way of programming that microcontroller, but quite often people use bootloaders to allow for easier firmware updates (that doesn't require a hardware programmer specifically for that line of microcontrollers), and those are usually custom.

To me, it looks like it has a bootloader, which has either become corrupt, or the new firmware you are trying to update it with isn't compatible, or is rejected in some way.

So, firstly, what software do you use to update the firmware?  And..
Is this whilst it is connected via USB? And..
Does that software provide options to reset the device to default?
 
The following users thanked this post: Berserk

Offline JTR

  • Regular Contributor
  • *
  • Posts: 107
  • Country: au
Re: PIC18F6620 asking for advice
« Reply #5 on: October 17, 2017, 12:02:31 am »
How can i convert .pic to .hex correctly?

Attachment: saved config of corrupt device

Attached is the bin file converted to hex with the config settings taken from your above file. No guarantees that this is all correct but it is a starting point and the disassembly looks sane.
 
The following users thanked this post: Ian.M, Berserk

Offline BerserkTopic starter

  • Contributor
  • Posts: 13
  • Country: ru
Re: PIC18F6620 asking for advice
« Reply #6 on: October 21, 2017, 04:35:09 am »
Attached is the bin file converted to hex with the config settings taken from your above file. No guarantees that this is all correct but it is a starting point and the disassembly looks sane.

It's Alive! Everything worked after sending your file, Thank you very much, already recovered 3 devices.

Thanks to everyone who tried to help me in that topic, you all are the best!
« Last Edit: October 21, 2017, 04:38:37 am by Berserk »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf