Can the BASIC Stamp be used to generate a microcontroller's clock?
Buck Rogers
Posts: 2,185
Hello!
New project time. Despite the fact that it would be using a BASIC Stamp, it is in the Microcontoller category and not Stamp one because it might not fit in that one. I also don't think the general one would work also.
Okay here goes: Can the BASIC Stamp be used to generate a microcontroller's clock? Basically the thing expects either an RC time constant based clock that produces a waveform with the periodic pulse of 19 microseconds. I looked over the Pulseout instruction and oddly I didn't see any guides towards selecting the right constant for that one. I have a collection of older devices, they are members of the COP400 family from when National was earnestly making chips thinking they would be able make one to save themselves from being glommed by a bigger and perhaps better device maker.
Normally I pick the right pair for this one, a COP411L device right off the bat, but since the thing will be talking to a PLD who'll be sending a data stream off to be processed and then displayed by the same stamp.....
I also thought of tricking a Propeller One board into doing the clock generation as an output function and then accepting a data stream via that same PLD and then displaying it via an LCD device, same as for the Stamp. But of course I figured on the Stamp first.
My big hurdle is figuring out how to successfully write the Propeller code to do both.
New project time. Despite the fact that it would be using a BASIC Stamp, it is in the Microcontoller category and not Stamp one because it might not fit in that one. I also don't think the general one would work also.
Okay here goes: Can the BASIC Stamp be used to generate a microcontroller's clock? Basically the thing expects either an RC time constant based clock that produces a waveform with the periodic pulse of 19 microseconds. I looked over the Pulseout instruction and oddly I didn't see any guides towards selecting the right constant for that one. I have a collection of older devices, they are members of the COP400 family from when National was earnestly making chips thinking they would be able make one to save themselves from being glommed by a bigger and perhaps better device maker.
Normally I pick the right pair for this one, a COP411L device right off the bat, but since the thing will be talking to a PLD who'll be sending a data stream off to be processed and then displayed by the same stamp.....
I also thought of tricking a Propeller One board into doing the clock generation as an output function and then accepting a data stream via that same PLD and then displaying it via an LCD device, same as for the Stamp. But of course I figured on the Stamp first.
My big hurdle is figuring out how to successfully write the Propeller code to do both.
Comments
A Propeller would be a better choice except for the 3.3V logic levels. You'll need a buffer that converts from 3.3V levels to 5V levels. The Propeller can do very precise timing of generated clock pulses.
I see what else I can do. Thanks always.
What big hangup? There are objects in the OBEX to do pretty much everything you mentioned. Just a matter of adding a few lines of code to tie the objects together.
Or a Counter/Adder in P1 can be set up to generate a NCO clock out, so you can do fine clock speed adjustments, if you wanted this more dynamic.
https://www.parallax.com/downloads/an001-propeller-p8x23a-counters
Coming from the Stamp, you could also look at PropBASIC ?
http://forums.parallax.com/discussion/166954/propbasic-update-june-2017
Okay thanks Mike. And you as well Kwinn.
Not exactly jmg. The PLD is the target. the output lines of the COP411L are also connected to it, as well as a pair of Hex displays. There's also a pair connected to the output lines of the PLD. The big black box below is the Parallax device both sending up a clock signal to the COP411L and then interpreting a serial stream coming from a single output line and translating the binary stream into ASCII characters on an LCD display.
As for PropBASIC it's also a thought.
Quick Start board.
Since I'm a five volt logic shop, with exceptions, I figured I might be able to directly power the QS from the breadboard's own power supply.
I have the sample code for the chosen LCD display, who is a "Parallax 2 x 16 Serial LCD (Backlit)" for both the Stamp and the Prop.
I'm going to spend the rest of the week studying those samples.
And Mike? Look for your favorite deli and have a good sandwich on me.
Next issue now, this is the Stamp2 program I use for extracting meaningful information from that running example,
It uses a cable such as the ones desktops did use for supporting CD-(DVD)-ROM drives and soundcards, to bring serial data into the stamp. From the stamp it gets displayed on the one described above. The cable for that one is one of the three-leaded ones that the firm does sell. The board they use is of course one of the firm's regular BOE Boards.
My next step will be to use that on the Stamp board to do all of that, while the clock program is running on the QS. However my problem here on the QS, is that of combining the steps such that the clock on cog program that Mike contributed, also does the same as my BASIC code does is being stymied by the lack of a template which I used on the Stamp to create that.
I'd say I've gotten a heck of a lot of work done here, and this confirms this is indeed a good group of people. Now all that remains is to try it all out.
SO assuming they didn't get zapped somewhere along the way, they might be about ready to fail and would be relatively hard to find a source for a new one. Yes Digikey still has the COP8 devices in stock but at nose bleed prices (like > $10). Even a P1 would be a better solution.
As for failing, I doubt that. You are aware that certain utilities are running their power plants on PDP-11s? And that there are some industries who are using S-100 systems for controlling their equipment? The list is endless. In fact four times a year, a Vintage Computer Festival meets in four such places, and the midwestern event just concluded.
The Eastern one meets next spring in a place in NJ, and with the blessing of the Moderators, I'll post it then.
But rather than deal with all the limitations of those old chips I'll spend a buck or two and start with something easier to program with more memory and builtin features.
Yes the FAA was using S-100 systems for air traffic control well past their lifetime. Gee did I feel safe when I learned that, not really. When I was working at Univac outside Philly (70s) they still had an ENIAC running, doing low priority printing or something. Those antique systems are interesting, but really a support nightmare for the maintenance people.
And while a Prop would be an excellent one for it, I'm not that fluent in the programming languages available for the device.
And since that Stamp program I shared is normally used to collect and display information generated via a completely different board/device it definitely wouldn't work for the controller described above.