Propeller programmable I2C peripherals - PPC
Peter Jakacki
Posts: 10,193
I have been having a bit of fun lately programming these cheap 8-bit micros as I2C slave chips for the Propeller. At present I am using the Silabs C8051F334(20-pin) but I am also working on the MC9S08SH. Both of these micros are very similar but the Freescale part is available in a variety of packages including DIP plus it can operate up to 5 volts.
What makes them appealing as I2C peripherals?
1) Cheaper than many I2C peripherals (Mouser 1 off 9S08SH4 for less than $2)
2) Includes Analog, Temperature, Digital I/O, timers/pwm, serial interfaces and RTC
3) Can be reflashed with new firmware in-circuit from the Prop using one dedicated I/O (or jumpered)
For those who are interested I will be making the Silabs C2 and Freescale BDM drivers available in Spin/PASM along with the I2C firmware images and source (for those who dabble). I really only load the programming software into RAM (F10) as I need it as it runs, reflashes the chips, then reboots back into the EEPROM application, all within a matter of a few seconds.
I am already using these chips in my designs but this will certainly be of interest to many forum members who use I2C chips. I initially used these for versatile A/D converters but I am now doing so much more with them and they have enabled me to offload the more mundane I/O tasks (and pins) from the Prop.
I have some of these chips monitoring the voltages on MOSFET drivers which the Prop can interrogate but more importantly the chips are programmed to automatically disable the drivers the instant they misbehave (overloads etc). Another chip is running a bunch of LED shift registers, dimming, and reading switches off the I2C bus. Admittedly I have one dedicated I/O line per chip just for reprogramming but it's worth it.
The level of interest I receive will dictate how much effort I put into polishing and documenting these chips for the forum. Let me know of any special requirements and I might be inclined to include that in the firmware.
*Peter*
What makes them appealing as I2C peripherals?
1) Cheaper than many I2C peripherals (Mouser 1 off 9S08SH4 for less than $2)
2) Includes Analog, Temperature, Digital I/O, timers/pwm, serial interfaces and RTC
3) Can be reflashed with new firmware in-circuit from the Prop using one dedicated I/O (or jumpered)
For those who are interested I will be making the Silabs C2 and Freescale BDM drivers available in Spin/PASM along with the I2C firmware images and source (for those who dabble). I really only load the programming software into RAM (F10) as I need it as it runs, reflashes the chips, then reboots back into the EEPROM application, all within a matter of a few seconds.
I am already using these chips in my designs but this will certainly be of interest to many forum members who use I2C chips. I initially used these for versatile A/D converters but I am now doing so much more with them and they have enabled me to offload the more mundane I/O tasks (and pins) from the Prop.
I have some of these chips monitoring the voltages on MOSFET drivers which the Prop can interrogate but more importantly the chips are programmed to automatically disable the drivers the instant they misbehave (overloads etc). Another chip is running a bunch of LED shift registers, dimming, and reading switches off the I2C bus. Admittedly I have one dedicated I/O line per chip just for reprogramming but it's worth it.
The level of interest I receive will dictate how much effort I put into polishing and documenting these chips for the forum. Let me know of any special requirements and I might be inclined to include that in the firmware.
*Peter*
Comments
I have to admit the price makes those devices looks them very compelling. I have played with the Silabs but not the Freescale (yet). I'm very interested in the possibility of doing away with the prop EEPROM and booting via the slave micro (for small prop programs)
There are some interesting versions of the C8051F such as the C8051F930. It has an internal charge pump and cap operate off 1 battery cell and supply 65mW externally (enough to run the prop??) . Also some of their others had nice fast ADCs
While the Silabs aren't available in DIP the daughter cards for $10 including pre soldered CPU make it very easy
I'm happy to dabble and test and see what can be done
tubular
There is no reason to use the I2C bus either since these chips have proper 8/9-bit UARTS so it is possible to talk to them easily full or half duplex serial from the Prop. In one application I have an I2C chip also monitoring the main serial receive line and it can receive a remote command over the network and place the Prop into reset while it loads up the EEPROM directly, so it's also handy for bootloading the Prop over RS-485 and radio networks.
@tubular
My emphasis will be on the Freescale part on this forum because of it's price and packaging but I am still playing with that chip at present. If you really like the Silabs parts and don't mind soldering 20-pin QFNs I can tidy up the project and post that material. Wouldn't a $10 daughter card be a bit prohibitive for most?
*Peter*
Have you figured out how to program it with a Prop over the 1-wire interface?
Or, how are you programming it?
I can pick up the 9S08SH4 chips for around $1 USD. How cheap is that! On the box that the demo board came in it says "So much integration at 5V, it shouldn't be called "low-end"". So my idea with these chips is to have "objects" just like we do with the Propeller expect the objects are Flashed into the PPCs. Actually the development environment for the MCS08 is quite interesting as it almost generates the code for you from the GUI using "beans". Just put them all together, this is truly "assembly" language
There are also versions with 16/32K of Flash which might be useful for EEPROM emulation as well.
*Peter*
Sounds interesting but I went even lower down the freescale food chain to the MC9RS08KA. I got their 'KA2 demoboard last week. Eventually I want to make a couple smart rgb leds. (Though lately I have decided that 74hc595s are even cheaper and easier for my project. )
Do you think you have anything that fits into the RS08KA?
Fred
I mix PIC, OOPIC, CORIDIUM, I2C and P8X32A chips freely. I believe this agnostic predeliction is due to my professional design experience extending back to the TTL and RTL (paleolithic) eras.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
That chip certainly is down the end of the chain, maybe even dangling off it. I think you find that there is not much of a price difference once you get down to this level so you end up saving maybe 50cents but you are completely crippled compared to the MC9S08SH. The RS08KA can be used but it's usefulness would be very limited plus the I2C slave software would be completely bit-bashed anyway soaking up a fair percentage of the meager memory.
@Jim: I believe I even have some uL911? chips floating around which if I remember is a single RS flip-flop or thereabouts.
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
by all means Peter I am certainly interested ! Break out the polish !
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Those who can, do.Those who can’t, teach.
*Peter*
That way I can just plug it into the standard 24LC256 socket and test a smart i2c booter. Alternatively I can leave the existing E2PROM in and piggyback with the 08SH at i2c address 1
Does anyone else have a use for such an adapter?
tubular
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Prop Tools under Development or Completed (Index)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Prop Tools under Development or Completed (Index)
· Emulators (Micros eg Altair, and Terminals eg VT100) - index
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Earl
Earl
The spin program is standalone and works simply by loading to RAM. The user CHIPS table has a list of I2C slave addresses to assign to each chip that is programmed whereas the C2CK table indicates the dedicate C2CK line of the chip itself. This program works but has no way of reporting success or failure but was written as a quick-load. It is easy enough to tie this in with some other software to report status. My initial programs simply used serial communications and a command shell.
I don't envisage anyone actually using these files as they are Silab specific however they are an introduction to the way I am using these chips as Programmable Peripheral Controllers or PPCs. In the next week or two I should have the MC9S08SH chip running and hopefully have the BDM driver completed to program these chips in-circuit.
*Peter*
It's designed for the MC9S08SH32CTG (32kB flash, 16 pin TSSOP, I2C, 8 ADC inputs, 2 pulse outputs, and more... )
The single wire background program/debug signal BKGD can be jumpered either to 24LC256 EEPROM Pin 1 (Normally A0), or to the Pin 5 (Normally SDA). Reset\ probably isn't required but can be jumpered across to Pin 3 (Normally A2) if required.
I'll get a handful of these run tomorrow on an 8 WD proto service, so let me know asap if anyone wants
tubular
http://www.atmel.com/dyn/Products/Product_card.asp?part_id=2004&ListAllAttributes=1
When I've used DAQ's from various manufacturers a few pins can often be set as PWM or timers depending on which flag you set. Since I'm just now learning about lower level mcu development (Propeller and other options), I'm unsure if this would work the same way with the MC9S08SH (Peter likely knows though).
From this diagram:
http://forums.parallax.com/forums/attach.aspx?a=29237
the MC9S08SH has 4 timers listed, but I don't know if they could easily be made into PWM's, or how many bits they are
The Atmega firmware I've seen is usually written in assembly too, so I'm guessing you would need to write assembly for the MC9S08SH. Since your Kalman work on the Propeller shows a comfort with assembly, this may be no big deal for you. : )
Post Edited (ianw) : 3/16/2009 5:53:24 PM GMT
I saw something in the MC09SH manual about being able to remove security after doing a bulk flash erase.
*edit* here's the text:
"(The background debug controller can only do blank check and mass erase commands when the MCU is secure.)"
I believe what they mean is "When the MCU is secure, the BDC can only do a blank check command or a mass erase command". I therefore assume you can perform these two commands plus many more when it is not secure.
Looks like you should be able to re-program using the single background debug wire (pin 2)
tubular
Post Edited (Tubular) : 3/17/2009 1:42:58 AM GMT
Looking through the expansive uC range there is also a QE series, which has a 12 bit ADC, and oddly may be cheaper than the SH (qty1).
I'm no expert on Freescale stuff, and unlikely to become one in a hurry (the shortform alone is 52 pages!). Would the QE series also work with your Prop-initiated flash programming approach ?
1 off Pricing from mouser (USD) on 4kb flash models
MC9S08SH4CSC (SOIC-8, 10 bit ADC) $2.23
MC9S08SH4CTG (TSSOP-16, 10 bit ADC) $1.85
MC9S08QE4CTG (TSSOP-16, 12 bit ADC) $1.44
MC9S08QE4CPG (DIP-16, 12 bit ADC) $1.44
I updated the DIP8 adapter board to either take a TSSOP-16 on the front, and SOIC-8 on the reverse. A 12 bit ADC makes it useful for me commercially (rather than just an experiment)
tubular