After I went through an arduous process of bootstrapping the S08, using a Freescale 68HC908QB8 as a BDM debug “host”, Freescale introduced the S08JS, which, unlike most other S08 parts, is not entirely blank when it comes from the factory. Instead, it contains a small USB bootloader, which is almost trivial to interface with over USB. Once I built a board, getting muforth to talk to the bootloader and program the flash was a few hours’ work at most.
Building the board was more of a challenge, and that’s what I’d like to document here.
Unlike the Microchip PIC USB parts, many of which come in easily-breadboarded DIP packages, Freescale’s only USB-capable S08 (prior to the introduction of the S08JS) was the S08JM family, which only comes in hard-to-prototype LQFP packages. I looked around for a while to find a basic breakout board for an LQFP 44 0.8mm pitch part, but didn’t find anything to my liking. (dipmicro now sell an LQFP 44 0.8mm pitch breakout board that would be perfect for this.)
Enter the JS16. This part, while not available in a DIP, is available in an SOIC 20 package. Once I stumbled over dipmicro's nice prototyping boards, I was ready to proceed.
The parts list for the board is roughly as follows (the costs assume quantity ten of each part):
- MC9S08JS16CWJ (free – got several as samples from Freescale)
- dipmicro proto board ($1)
- 4 MHz crystal ($0.14)
- 2x 4.7uF tantalum capacitor (junk box)
- 2x 0.1uF mica capacitor (junk box)
- 2x 22pF capacitor (junk box)
- female USB type “B” connector ($0.24)
- 1M ohm feedback resistor, 2% ($0.03)
- 2x 33 ohm USB resistor, 2% ($0.06)
- header pins (21 pins) ($0.11)
- hookup wire salvaged from CAT3 cable (junk box)
Total cost: $1.58
Of course, I had to buy the parts in lots of 10 or 20, so the real cost is more... But I’m hoping to make a few more of these boards. They are really useful!
Just for fun, if I paid the quantity one price for everything (well, everything except for the capacitors, of which I have a ton), how much would the board cost?
- S08JS16: $1.44
- proto board: $1.93
- crystal: $0.26
- USB connector: $0.33
- resistors: $0.24
- header pins: (one 40-pin 1-row header): $0.32
Total (unit) cost: $4.52
Still pretty reasonable. ;-)
Except for bringing out a few pins to headers on the board, my design follows the schematic on page 23 of the S08JS reference manual, bearing in mind the following:
- The feedback resistor across the crystal is not optional! I fitted a 1M ohm resistor, which works fine.
- There are many possible crystal options. I forget all the possibilities, but 4 MHz, 6 MHz, 8 MHz, and 12 MHz all work fine. I’m using a 4 MHz crystal because I can also use with other members of the S08 family that have a simpler clock source on chip with an external oscillator that only works up to 5 MHz.
- If you want to use the on-chip USB voltage regulator, the bypass caps on Vusb are not optional. The values aren’t critical. I think I used similar values to those on the schematic.