Basic Stamp 1 DIP Serial Communication UART and USART
microcontrolleruser
Posts: 1,194
in BASIC Stamp
Anybody been through this subarea of microcontrollers?
When you put a Stamp 1 on a breadboard and it communicates with Basic Stamp Editor and Terminal
how is that done?
I doubt if the 16F5x the Stamp 1 starts out as has a UART or USART on it but then again I know very little about it.
Comments
There's a Nuts and Volts column (#20 here) on the subject of the BS1 DEBUG statement and how it communicates with the Basic Stamp Editor.
The SEROUT (and SERIN) statement do "bit banging" where there's a subroutine in the BS1's interpreter that takes care of timing and I/O pin manipulation. There's no built-in UART or USART.
Okay. I know a little.
The way the Stamp DIP is done is that like the old serial and parallel port programmers for PIC's?
Well I guess it must have some resemblance because that in essence is what it is doing.
Let me add now there is EUSART or EUART which is probably 'Enhanced UART'.
Yes I am interested because I am build a dev board that swears all you need is a USB hardware connector for it to work.
Must have a UART on the micro.
Thanks!
This was in N&V #16 by Scott Edwards.
'The Stamps do away with the whole concept of dedicated serial ports, instead treating
serial I/O as just another function of the normal I/O pins.'
It is similar to the programmers of the time that were simple and inexpensive alternatives
to expensive ($200 in 90's dollars) Microchip programmers.
Then Parallax added the 'tokenizer' and some commands and away they went!
Forgot a little proprietary hardware too.
That takes care of that!
This continues in the Propeller: no hardware UART. This provides a lot of freedom and flexibility. I am recently learning how good FDS for the Propeller is versus SoftwareSerial in the Schmarschmino.
Thanks Jon
The hardcore way to learn about UART would be to add one of these to a micro.
http://www.futurlec.com/80Series/8251A.shtml
If you wanted to wimp out you could use a micro with a UART as a peripheral built in.
Tend to think the pay off is less code and less program memory used.
The Propeller can do USB with just a USB connector and a couple of resistors. One of the problems you run into with USB is that any but the simplest devices (like keyboards and mice) require a complex, sometimes proprietary I/O driver. Mass storage devices for example might use any of a number of file systems (FAT, FAT32, ExFAT, NTFS, HFS+, ext, ext2 just to name a few).
So you know about TICkit?
More of an engineering angle than Basic Stamp.
No educational type material. Looks like they started around the same time.
Yes. I did sense 'pin-eating' with that Futurlec UART.
Where does RS232 chip fit in with Stamps?
It is not listed as necessary to get Stamp DIP running.
What would you gain if anything by using an RS232 IC?
The BS-1 programming adapter, (RS-232) could be used in conjunction with the USB-to-Serial adapter.
Publison
Thanks!
That would be cheating!
Us real tinkerers have to put thing together from parts.
You do have a point.
The Parallax Serial Adapter you point out has an RS232 IC in it.
This is a can of worms! I will think about this some more.
I used to do that -- then knocked out this little board.
-- http://www.efx-tek.com/topics/prop-1_usb.html
Mike
When I do dive into it I think the RS232 is the place to start.
'Learn while doing'.
It's still a can of worms.
Jon
That's a nice piece of hardware you made!
Okay. This requires more investigation.
Probably a lot more!
Have a couple possible plans here.
Work up from servo motor to an IC. Maybe an ADC or PWM.
Might look at I2C communication to an EEPROM. Maybe even with a micro where you can see what's going on.
Maybe an SX or something else.
We'll get there one way or another!
Be a micro interface expert or professional!
-- Servos? Easy. I wrote a Spin-only driver that handles 8 servos with ramping; could be bumped to 16 without headaches.
-- ADC? Easy to attach any ADC you like.
-- I2C? The Propeller already has an I2C bus for the EEPROM so you don't give up any pins. Coding is a breeze.
-- 1-Wire? No problem; I have code based on direct info by Dallas Semiconductor engineering.
-- Smart pixels? I have been using them since they first came on the scene.
And look at all the cool things people like Mike Green and others have done. It's why allow myself time in these forums: to learn from people like Mike.
THE SX IS DEAD. I know you don't want to believe it, but you'll get pigs to fly before you get an real traction out of the SX. Again, thank your pals at Microchip for that.
The question is really this: Do you want to be productive as an embedded programmer, or do you just want to play with chips to pass the time? Nothing wrong with the latter, but being productive is a lot of fun, too -- and can earn you cash if you do it well.
' play with chips to pass the time'
That sounds darn right relaxing.
Wish I had thought of that!
This period of time is a vacation for me so I am attempting to enjoy it.
As we used to say I'll get 'yanked out of here' soon enough.
This (place speech from Henry VII here). 'This English isle...'.
This was the hard way to do it.
Now I see the benefit of peripherals.
That way you are not 'fighting a war on two fronts'.
You get a chip with the peripheral you want and then it becomes a software only issue.
It is interesting adding hardware peripherals to the Basic Stamp though.
See the process that brought about peripherals first hand.
Which way? Are you talking about soft peripherals like the way the Propeller does it or hardware peripherals the way most other microcontrollers do it?''
You can add hardware peripherals to a Basic Stamp and there are nice peripherals available these days that do all sorts of things. Many of them use SPI or I2C interfaces that don't require too many I/O pins to support.
The Propeller 1 was designed to mostly use soft peripherals including Analog to Digital conversion and video output. If you want another ADC channel, just load up the necessary software into another cog. You don't have to hope the manufacturer has made up another part with the number and types of hardware peripheral units you need. If you need a peripheral that does something special like handle 9-bit asynchronous serial data, you can modify existing software to do that ... and do it quickly with little effort.
Mike
The 'baby steps' of adding stepper motor is headed in right direction.
I think adding EEPROM to Stamp 1 or 2 DIP would be a good project.
Will look into Analog to Digital and the other way around.
Will have an SX DIP soon. Two of them actually.
Better start out with Stamp though.
That 'two fronts' thing.