'RS08 Port Expander

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

'RS08 Port Expander

4,361 Views
Curt
Contributor IV
I realize that this sort of misses the point of the RS08 -- but has anyone designed an I/O port expander for this device?
Labels (1)
0 Kudos
13 Replies

856 Views
bigmac
Specialist III
Hello,
 
Since you may not have IIC or SPI modules within the device you are using, the simplest method of expansion is to "bit bang" what is essentially a SPI interface, to communicate with HCMOS shift register devices.
 
For something like a DIP switch interface, that does not need to be buffered, I have used the 74HC165.  For buffered inputs, the 74HC589 or 74HC597 are possibilities, and for buffered outputs the 74HC595.  Multiple shift registers may be cascaded for as many inputs or outputs as you need, without requiring additional MCU pins.
 
Of course, I/O access will be relatively slow, and significantly slower than if a hardware SPI module were present in the MCU.
 
Regards,
Mac
 
0 Kudos

856 Views
Curt
Contributor IV
Thanks for the ideas.  I'll check out the NXP devices and take a look at I2C as a protocol (any links to those I2C bit-bang app notes?) 
 
Note to Freescale:  how about an 'RS08 with an I2C engine?
 
Most of my work has been with an '8051 architecture -- but I'm really fascinated by the minimalist nature of the 8-pin uC, and will be starting my first design with it next week. 
It needs to communicate with another uC on one side (2 bits), and two motor controllers on the other (2x (step, direction) out, 2x (limit in).  So I need two more bits!
 
Thanks again,
Curt 
0 Kudos

856 Views
Curt
Contributor IV
Oh yes...  the NXP I/O expanders are just what the doctor ordered.   So now I need to
go find out how to bit-bang an I2C interface, and I'm practically done! 
0 Kudos

856 Views
Curt
Contributor IV
And ap. note AN1820 here at Freescale has code for bit-banging the I2C protocol --
so I'm in business.
 
BTW -- is there any way to edit a posted message on this system?
0 Kudos

856 Views
peg
Senior Contributor IV
Hi Curt,
 
You can certainly do this expansion to get more i/o on this device. I have used all of the parts plus more suggested by bigmac.
If this is just some kind of expermental exercise then good luck!:smileyhappy:
 
If not then I would suggest a sit back and re-think.
How many are you intending to produce?
Much more powerful devices can be had for a dollar. Is all this extra work (and part cost) going to be offset by the slightly lower up front cost of the device.
You could be limited in future upgrading of your device by the limited grunt these things have.
You will be using up some of the already limited resources of this device just to perform this expansion.
I would suggest giving the S08QGx a good look at before you wander off down the RS path too far.
 
Also if you are going to stick with the expansion of the RS...
I would advise, like bigmac, that you go with SPI for expansion. The devices you use for this are cheaper (they are just simple logic devices) and the bit-banging to get it done is simpler. Two things that go hand in hand with the RS.
 

Message Edited by peg on 2007-03-1608:54 AM

0 Kudos

856 Views
Curt
Contributor IV
Hi Peg.
I realize that I/O expansion kind of misses the whole point of the RS08.  My interest is more theoretical (although I _do_ have a product idea...)  If I were teaching embedded control, I'd make my students start with this device as a means of learning some old fashioned design discipline.   Nobody's going to be trying to write a lot of floating point "C" for this bad boy. :smileyhappy:
 
I think I've concluded that the best way to get one or two more highly versitile I/O bits out of the RS08 is ----  to use another RS08!  Depending on clock tolerance, it should be a piece of cake to code a fast, one-wire RS08-RSO8 link, so two devices would give you 10 bits of fully-configurable I/O.  I'll be experimenting with this.
 
BTW -- how did you edit your post?  I've been looking around here, but haven't found the way yet.
 
Regards,
Curt
 
 
 
0 Kudos

856 Views
peg
Senior Contributor IV
Hi Curt,
 
You can edit your message by clicking on "Message Options" on the grey bar above the message.
It must be YOUR message and it must be within 2 hours (or so) of posting it.
 
One point I would make about teaching using this device is that the architecture is really a hacked down version of normal and so does not represent the typical real world case.
 
Also when I said easier to implement SCI over IIC, mainly this would be that there is no addressing and the like, which is also the case for a custom 1 to 1 setup as you propose. There is also the hardware problem to consider in emulating IIC using a normal push-pull output.
 
0 Kudos

856 Views
Curt
Contributor IV
I take your point about teaching Peg -- but tend to be hugely suspicious of words like
"normal" and "real world."  As a student myself, I spent many happy hours writing algorithms for a RISC machine that had only 4 instructions!  (I fancied becoming an "automata theorist" -- so abandoned interest in the "real world" early on.:smileyhappy:)
 
With an NRZ-encoded one-wire bus, I recon it would be theoretically possible to link up dozens of RS08's.   Organize a few hundred of these wires into an xy grid and you have a whole new processor.  Stack a few dozen of the grids vertically and --- hold on!  I'm thinking DARPA contract here!   A 3D cellular automaton for $0.53 per node...
 
I'm maybe thinking processor-per-pixel image processor.
 
Anyway ...  the possibilities seem endless.  The RS08 may be a hack _down_ from "normal" -- but a leap _up_ compared to what you normally find in a cellular automaton.  
 
Now I'll see if I can edit this. 

Message Edited by Curt on 2007-03-1605:45 AM

Message Edited by Curt on 2007-03-1605:45 AM

Message Edited by Curt on 2007-03-1605:46 AM

0 Kudos

856 Views
bigmac
Specialist III
Hello,
 
I think the following can be said about the 'RS08, some of which has already been mentioned by Peg -
  1. If using a Freescale MCU for the first time, the 'RS08 is probably not the best learning tool because of complication and restrictions when programming in assembly language (compared with HCS08 = "normal" ).
  2. The 'RS08 devices will probably never be suited to extensive C programming, because of their very limited resources.
  3. Consequently, the additional time spent programming the 'RS08 (compared with HCS08) will not justify the saving of a few cents per piece, unless the production quantity is very large.
  4. Even if the 'RS08 might be considered for a future product, the "proof of concept" would probably utilize a HCS08 device, for faster turn-around of ideas.
I have likened the ease of assembly programming a Microchip MCU as attempting to "wag a dog by its tail".  It would seem IMHO that the 'RS08 has a tendency in this direction.
 
Regards,
Mac
 

Message Edited by bigmac on 2007-03-1604:57 PM

0 Kudos

856 Views
joerg
Contributor II
Hi
as i am also a teacher for the MPU stuff, i think Mac is right! For me the RS08 devices are not really suited for teaching. I have written the EBS08R for the KA2, and must say i felt like when the first Intel uP's came up. Paging with MMU's are really not so easy to understand, but the worse thing is if the students have messed up the code they will spend a lot of time with debugging (this may be helpful sometimes) and so they do not get the basic idea of the task. As i have had to teach HC11F1, and there where problems with the BSET/BCLR (and other OPCODES) due to the lack of 16bit addressing, i know what it means to do debugging with a group of students! All the experiences i made have been the trigger to design the HC(S)08 system!
So if you will introduce a new MPU i would suggest the HCS08 family (i.e. the QG8 or QD4).

Saluti Joerg
0 Kudos

856 Views
Curt
Contributor IV
Now that I've written some code for it, some thoughts on the RS08...
 
I can certainly understand the BigMac and Jeorg views on the device in an MCU teaching environment.  No stack?  No vectored interrupts?  Hardly an MCU at all! 
 
But....
 
If you're teaching, say, Theory of Computation -- Wow!  This isn't a gutted MCU -- it's a register machine with a very restriced (input+output) alphabet of 64 (max) symbols -- on steroids!
 
And what better way to introduce a student to the joys of a stack than having her live without one (or making her implement her own from a more-primative set of instructions)?  Same for vectored interrupts.  Why not just one?
 
It's interesting to me that Freescale decided to introduce this device as an MCU (with the struggle to legitimize it as a legal heir to the '08) -- rather than introducing it as a whole new class of "register machines"  RISCier than RISC.   After all, somewhere between the land of FPGAs and the land of 32-bit MCUs with 128K memory (God forbid, God forbid...)  there must be a place for an array of humble RS08-like devices.   Think not "sea of gates," but "sea of register machines."   Wow. 
 
0 Kudos

856 Views
Curt
Contributor IV
I appreciate your thoughts and think I'll have to wait until I've had some hands-on experience with the RS08 before I can offer any sort of meaningful response.  
 
Regards,
Curt
0 Kudos

856 Views
baddad
Contributor I
If for some reason you can't migrate to a device with more I/O, I would buy an I2C port expander from NXP.  You can get devices with 8 to 40 bits of I/O.
 
There are app notes out there for bit banging the I2C that could be ported to the RS08.
 
BadDad
 
 
0 Kudos