Author Topic: ISP entry  (Read 1714 times)

jdr

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
    • Email
ISP entry
« on: January 22, 2016, 05:56:27 pm »
I have an XA-G49 on a system with only the "minimum pin" access pictured in Data Sheet Figure 4. How do I enter ISP for reprogramming.


Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2105
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: ISP entry
« Reply #1 on: January 25, 2016, 09:49:51 am »
You need to pull /PSEN low, leave ALE floating and pull /EA high while resetting the part.

See the section immediately before figure 4 titled "Hardware Activation of the Boot Vector".

Embedded Systems Academy, Inc.
support at esacademy dot com

jdr

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
    • Email
Re: ISP entry
« Reply #2 on: January 25, 2016, 05:42:06 pm »
Thanks for responding. I don't have access to the PSEN. Can I use a "Break Set"? Is there anyway to get the XA-G49 to go into ISP mode with just two lines TX and RX? Figure 2 in Application Notes AN716 make reference to just having two lines, is that based on already being IN ISP mode?


Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2105
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: ISP entry
« Reply #3 on: January 25, 2016, 05:49:16 pm »
You can do it in software by setting the status byte and performing a reset. I guess that the minimal circuit either assumes that method or assumes you have access to the /PSEN, ALE and /EA pins.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

jdr

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
    • Email
Re: ISP entry
« Reply #4 on: January 25, 2016, 07:59:20 pm »
So... I write the STATUS BYTE to a non zero value how? Confused on the procedure.
Wouldn't I have to flash the chip initially with code that allowed me to trigger a write to the STATUS BYTE from some signal through the only two lines I have. The P89LPC932 chip does have this feature "Break Detect"  but I don't see it mentioned for the XA-G49.
Am I missing something?
Thank you for your patience.

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2105
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: ISP entry
« Reply #5 on: January 25, 2016, 10:10:08 pm »
So... I write the STATUS BYTE to a non zero value how? Confused on the procedure.
Wouldn't I have to flash the chip initially with code that allowed me to trigger a write to the STATUS BYTE from some signal through the only two lines I have.

Yes

The P89LPC932 chip does have this feature "Break Detect"  but I don't see it mentioned for the XA-G49.
Am I missing something?

If a feature isn't in the chip documentation then it doesn't have it...
Embedded Systems Academy, Inc.
support at esacademy dot com

jdr

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
    • Email
Re: ISP entry
« Reply #6 on: February 10, 2016, 06:33:27 pm »
I don't mean to beat a dead horse... but this is bugging me.
I have to assert PSEN low to enter ISP mode to program the chip but it states I can write the STATUS BYTE to a non-zero value to enter ISP. I have to be IN ISP mode to write so what scenario would I write to the STATUS BYTE to get into a mode I am already in???
Thanks,
Jeff

Andy Ayre

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2105
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: ISP entry
« Reply #7 on: February 10, 2016, 07:20:26 pm »
The status byte is for people who want a software-based method of starting the bootloader. For example perhaps their firmware accepts a special command over the UART that when received sets the status byte and then causes a reset.

The advantage of this method is that it doesn't require manipulating pins, i.e. having the end user press buttons. Therefore, going back to your original question, if you have only the minimum pins in your hardware you can use this method to get into bootloader mode. Clearing the status byte and reset gets you back out of it. So you can go back and forth. The critical point is that a blank device - i.e. new from the factory - resets into the bootloader. So the very first time you program it you include support for this method.

The disadvantage is that if your firmware doesn't run for some reason then it won't work.
Embedded Systems Academy, Inc.
support at esacademy dot com