USBDM programming issue with S08 micros - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: December 13, 2023, 04:48:06 am
content: Been using the USBDM programming adapter and for the most part it has been great. One issue I found when programming S08PA and S08FL micros is about 50% of the time the following error message appear - “Connection with the target has failed. Please cycle power to the target. Retry connection? Y/N”Cycling the power to the mcu generally fixes the problem. The thing is, it only happens with a micro that has never been programmed. Once it has been programmed at least once it never happens again. This is not a problem for software development because of course the micro get programmed again and again, but for production usage it can be a bit of a drag. I have programmed about 5000 micros with it, so I have had to cycle the power a LOT.BDM firmware version 4.12.1DLL version 4.12.1.320Running on Linux Mint Mate 20.3Kernel 5.4.0-169

author: pgo
author_rank: Regular Contributor
timestamp: December 13, 2023, 10:34:16 am
content: Hi,You have not given the hardware version you are using so it makes it difficult to be definitive.Unfortunately, some 9s08 devices cannot be guaranteed to be forced into BDM mode except by a power-on-reset i.e. cycling the power while holding the BGND pin low.If the hardware you are using does not have a controlled target power supply it may be necessary to manually cycle the power while the BDM keeps BGND low.The second method given below is NOT guaranteed to work as it is possible on some devices to disable the BGND pin defeating programming. I'm a bit surprised that it happens with blank devices but it may be timing related e.g. a watchdog or illegal instruction reset occurs before the BDM can make a connection and halt the target.byeFrom 9s08 manual:The method for forcing active background modedepends on the specific HCS08derivative. For the 9S08xxxx, you can force active background after a power-on reset byholding the BKGD pin low as the device exits the reset condition. You can also forceactive background by driving BKGD low immediately after a serial backgroundcommand that writes a one to the BDFR bit in the SBDFR register. Other causes of resetincluding an external pin reset or an internally generated error reset ignore the state of theBKGD pin and reset into normal user mode. If no debug pod is connected to the BKGDpin, the MCU will always reset into normal operating mode.

author: Circlotron
author_rank: Super Contributor
timestamp: December 13, 2023, 10:38:09 am
content: How would I determine which hardware version I am using?

author: pgo
author_rank: Regular Contributor
timestamp: December 13, 2023, 10:40:35 am
content: There is a table on the page below of the official versions.https://usbdm.sourceforge.io/USBDM_V4.12/html/index.htmlmost of the ones on ebay etc are modifications of the USBDM_JS16CWJ version.byePS. you could post a picture of the PCB.

author: Circlotron
author_rank: Super Contributor
timestamp: December 13, 2023, 11:25:50 am
content: Okay, here's a picture.I just noticed that the red jumper is in the centre position. Is that significant? My boards run on 5V from an onboard reg and external 12V supply.

author: pgo
author_rank: Regular Contributor
timestamp: December 13, 2023, 12:04:42 pm
content: Hi,It's amodifiedUSBDM_JS16CWJ(it's labelled on the board!). It has some extra protection(?) diodes I think.It has target power but it's not automatically controlled - that is what the jumper block does.When you are prompted to cycle the power you can use the jumper.Perhaps you could add a normally-closed switch instead of the jumper to be more convenient or at least a jumper with a tag.If your target board has its own power then you should remove the jumper (although the extra diodes may protect against reverse powering the USB port).bye