Jaromir Sukuba

USB-MON08 - How I did it. - 9S08GT16A

Discussion created by Jaromir Sukuba on Jul 17, 2008
Latest reply on Mar 24, 2018 by Jim Evans
Hi all.

This post is not EXACT way how to do it, because I still didn't draw properly schematics (I'm out of office now). But if you are experienced, you should be able to get the point and replicate my work or you should be inspired how to do it with other components (I used just parts from my junk box). Hope everybody interested will enjoy it.

I fell in love with HC08 chips a time ago, but after I found out my new laptop does not have any serial port and classical MON08 doesn't work with serial/USB adapters, I cooled down. For my home projects I really wouldn't spend a lot of money to buy some professional tool, so HC08 went into background. Here on forum are a few messages about developing and debugging with HC08 chips without "real" RS232 port or without a tool from P&E or other manufacturers (conclusing it's impossible - until now, read on).
I decided to try to find out what's actually happening and why RS232/serial converters doesn't work. In fact they work very good most of the time, until there comes to break signal. Break signal is very obscure thing, because for HC08 and HCS08 break signal is 10 or 11 bit long zero on line, but for other MCU's (like microchip MCU) or for example in LIN protocol, break is 13 bits long zero on line. I wasn't able to find ANYTHING about receiving or transmitting breaks in documentation of USB/serial conveters, but apparently that chips requring also 13 bit long break. When it comes to break in MON08 protocol, conveter just doesn't understand it as a break, and reports 0x00 or something else. This is of course bad. But this situation also clearly implies what to do with it. We just need to make breaks longer than 10 bits, all other bytes should be transparently send on.
So I did what I had to do. I took board with FT232BM and 9S08GT16A device (it's equipped with two SCI's, that is good for my task). Schematics (very very rough and incomplete) is here.

http://jednocipy.kvalitne.cz/usbmon08/usb_mon08.png

GT16A runs on 24MHz (12MHz bus) with 4MHz resonator. SCI1 is connected to FT232BM, SCI2 with two passives creates simple MON08 adaptor. This connects to target (in my case HC908JK8), IRQ pin is switched to 8,5V (there is mistake in schematics, voltage source should be 8,5V). Reset is switched to ground via pusbutton. JK8 runs with it's own oscillator, 7,3728MHz crystal, thus the MON08 speed is 7200baud.

Firmware in GT16A is quite simple and I created it in about 10 minutes. SCI waits for a character and if it's not a break, passes on other SCI, if it's a break, set lower baud rate and send 0x00 (0x00 at lower baud rate actually creates a break). Quite simply, isn't it?
Firmware is here.

http://jednocipy.kvalitne.cz/usbmon08/main.c

I would like to mention again, the project is very very alpha version, quick and dirty, but it really works. I can program and debug my good old JK8 with no RS232 port!
Schematics is incomplete (for example no capacitors at supply or with crystals etc...) but it will give you a rough picture, source code is very very simple and straightfoward with fixed baud rate (external switches would be nice to accomodate various baud rates for various targets). I also would add oscillator (7,3728MHz to 7200 baud or 9,83MHz for 9600 baud, but this will require slight changes in firmware) and Vtst source (probably MC34063 or something like that to create 8-9V from 5V USB). I don't have PCB for it. I reused PCB for GT16A, which is leftover from another project, other connections are made on piece of universal PCB.
As far it's just alpha version, but I gave it to community for inspiration. I'll probably work on it in my spare time, so no guarantee of developement speed.

Cheers,
Jarin



Message Edited by jarin on 2008-07-17 10:51 AM

 

Added p/n to subject.



Message Edited by NLFSJ on 2008-07-17 07:29 AM

Outcomes