Author Topic: USBDM programming bug when port drive strength bits set?  (Read 404 times)

0 Members and 1 Guest are viewing this topic.

Offline CirclotronTopic starter

  • Super Contributor
  • ***
  • Posts: 3180
  • Country: au
USBDM programming bug when port drive strength bits set?
« on: August 29, 2022, 10:54:57 am »
Had my USBDM programmer for some weeks now and it is the duck's guts! Love it.
Struck a weird problem just now though. Had a 9S08PT16AVLC chip and usually these program easy peasy. This time I had three LEDs connected to PORT B 0,2 & 3 with a 1K resistor in series with each. I decided to set the port drive strength bits to "on" just for good measure. Set $1860 to #%00001101. After that the chip became very reluctant to connect to the programmer. Sometimes had to try twenty times or more. Resetting power every time. The "detect chip" button almost never worked either. Error message said it had lost connection. Eventually the detect chip would work and only after that I was able to program the chip. But my software would not run! After a lot of messing around I commented out the lines that gave the PORT B pins stronger drive, and... voila! Everything began to work perfectly! Programmed up and software ran great. Tried it half a dozen times or so. Now that's weird. Can anyone cast some light on this?


Edit --> found it...
Was using a S08FL datasheet instead of S08PT...   :palm:
Address $1860 is correct for PORT B drive setting in FL version but is in the "unimplemented" area of memory in a PT version.
So that address actually seems to do something, but who knows what???
« Last Edit: August 29, 2022, 11:45:22 am by Circlotron »
 

Offline pgo

  • Regular Contributor
  • *
  • Posts: 69
  • Country: au
Re: USBDM programming bug when port drive strength bits set?
« Reply #1 on: August 30, 2022, 11:47:55 am »
Hi,

It is unlikely that there is anything special about the memory location you are accessing.
I think it is more likely that after programming the broken program that the chip is suffering form repeated resets cause by the 'illegal address' reset (this is a reset trigger on some 9s08 devices).
This can make it difficult for the BDM to get a connection for long enough to actually activate the BDM interface and stop the processor.

The only guaranteed way to program a 9s08 device is using a power-on-reset into active background mode.  Most of the BDMs don't directly support this as they don't control the target Vdd.
If the programming software has difficulty connecting it may request manual power sequencing but this may not happen in the above case since it makes an initial connection which is then lost after the reset.

bye
 
The following users thanked this post: Circlotron


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf