Author Topic: PIC read IO pin using BTFSS not doing a thing  (Read 3931 times)

0 Members and 1 Guest are viewing this topic.

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #25 on: September 13, 2018, 08:46:42 am »
Here's the Microchip forum post from 2010 where a member of the Microchip PICkit 3 development team 'leaked' the PICkit 3 firmware image complete with bootloader, suitable for reflashing it by ICSP.  https://www.microchip.com/forums/FindPost/481245

You'll need a spare programmer that can flash a PIC24FJ256GB106 in-circuit from a Microchip format HEX file.

As its a rather old firmware version, and if you use it, the Pickit 3 hardware is already suspect, its a good idea to use the
PICkit3 Programmer Application and Scripting Tool v3.10*

to check it can program a PIC, then use the above utility to revert the PICKIT 3 to MPLAB mode which will force a firmware update when its next connected to MPLAB.

Using MPLAB 8 to debug assembler code on older PICs is still a valid strategy - it at least will show you which RAM and FLASH locations are reserved for the debug executive for your PIC when you open the memory views, and as long as you are using MPASM in relocatable code mode, should be able to load the symbol table to support symbolic debugging.

On the subject of what dies due to over-voltage damage to PICkit 3 programmers see my comments in https://www.eevblog.com/forum/microcontrollers/pickit3-not-working/msg1008468/#msg1008468

* CAUTION: this tool installs PICkit 2 emulation firmware with all that implies i.e. limited device support.  You MUST *EITHER* run the menu item in the scripting tool to revert to PICkit 3 firmware *OR* hold down the button when plugging it in to USB to force bootloader mode, to return to using MPLAB 8 or X.   This utility does NOT require MPLAB 8 or X to be installed.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3398
  • Country: us
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #26 on: September 13, 2018, 10:46:39 am »
Back to the original question, you could also:

Code: [Select]
mainoo
     btfss     PORTA,RA1
     bra       ledon     ;or goto
     bra       ledoff    ;or goto or just have your ledoff rountine

ledon
<code>
     bra       main00
ledoff
<code>
     bra       main00       

That is, assuming ledon and ledoff always go to main.
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #27 on: September 13, 2018, 10:50:27 am »
well, open a ticket, they'll probably replace the two genuine ones :D better than nothing

When I logged a fault for my PK3 which died they said I should buy an ICD3 instead.

I thought that was a little bit of a cop out, but I did end up buying one and essentially havent looked back. Way more reliable and far fewer issues than I was having with the PK3.

ICD3 does still have a few issues and I need to unplug and re-plug USB every so often, but no where near as frequently as I used to have to do with PK3, which could sometimes be every single time I needed to program a device. ICD3 I can sometimes get a week or so before needing to unplug it, and other times may need to do it a couple of times before it stops playing up.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3398
  • Country: us
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #28 on: September 13, 2018, 11:34:13 am »
I had basically the same experience as TomS_

My PK3 had early death and Microchip replaced if for free.  The few Times I have used it over the years it has been fine, but I always power the target separately.  In the process of the exchange Microchip offered a good discount on the ICD3, and it has been my goto since.   I can usually power from the ICD3 unless some power hog is on the board, like an LCD backlight.
 

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 822
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #29 on: September 13, 2018, 11:59:17 am »
Quote
'leaked' the PICkit 3 firmware image complete with bootloader
I think the firmware is inside the PICKIT3.jar file in mplabx.

 
The following users thanked this post: JPortici

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #30 on: September 13, 2018, 12:22:46 pm »
I don't know about the current MPLAB X version, but historically, the firmwares MPLAB X downloads to the PICkit 3 to support different PIC families, and the base PICkit 3 firmware it uses to upgrade old versions, didn't include the bootloader which made them useless for recovering a bricked PICkit 3 using an external programmer.

If that's no longer the case, it would help the community if someone familiar with the current MPLAB X would write out a cheat-sheet for locating the firmware + bootloader and re-flashing the PICkit 3 PIC24FJ256GB106.
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: gb
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #31 on: September 13, 2018, 12:35:45 pm »
In the process of the exchange Microchip offered a good discount on the ICD3

 :( they didnt offer me any discount.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #32 on: September 13, 2018, 12:42:30 pm »
That depends on whether or not they've got a current trade-in offer on devtools.  They usually run one when they want to obsolete a devtool, I *guess* to move as many as possible paying customers to current tools to minimise their support burden.   Previously some of the offers have been good enough that its been worth acquiring a PICkit series  programmer to trade in and  take advantage of the offer on an ICD series one.
 

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 822
Re: PIC read IO pin using BTFSS not doing a thing
« Reply #33 on: September 13, 2018, 02:21:44 pm »
Quote
didn't include the bootloader
Looks like probably still true. I scanned the hex files for a data record with an address of 0000- didn't find any. Looks like the scripting tool download is still needed. My bad.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf