Bit blasting (pulseout) RS-232 serial data....
StampUSR
Posts: 48
Has anyone sent RS-232 data using pulseout/bit-blastin? If so is there any example code available to get me started?
Can't use SEROUT as it doesn't support the comm parameters I must use.
Thanks!
Can't use SEROUT as it doesn't support the comm parameters I must use.
Thanks!
Comments
·· This might be a job more suited to an SX chip.· You could build a custom serial interface.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
The SX by itself won't work for me, not enough code space. I am trying to add a feature to an existing app. on a Stamp.
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
The hardware is done and 'out in the world.' If possible I want to add another feature as a software only upgrade to it. A co-processor isn't going to get that done for me. Even if I did integrate a co-processor SX I'd still have to write the bit blasting routines for it since SX/B also doesn't support the comm parameter I am looking to send. Since that is the case I'd rather just do the bit blasing in the Stamp if it is possible and have it work within my existing hardware.
Thanks!
Others have built PIC co-processors to do this, and I believe there's even an 8-pin AVR solution.
What are the comm parameters you 'must' use?
If you have an installed base, what comm parameters are they using now?
I now have to ask the obvious question, that no one has yet bothered to ask. What communications parameter are you hoping to use that's so elusive? It's got to be 9-bit word length or something real odd.
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 9/7/2005 8:47:15 PM GMT
I'm running the BS2PX so it is closer to 19k instructions per second. Don't know if that is fast enough either though, that is why I asked. Before sending it would calculate out all the pulses ahead of time (and store that) then just run a loop to send the pulses either reading from scratchpad or from EEPROM.
"Others have built PIC co-processors to do this, and I believe there's even an 8-pin AVR solution."
That would be more difficult then just moving to a PIC for everything.
"If you have an installed base, what comm parameters are they using now?"
Whatever they need to use as long as it is either 8N1 or 7E1. The parameters/baud rate are configurable by the user as needed to fit the devices they are using it with. That is why a coprocessor makes things more difficult... it isn't one set parameter all the time. It needs to be adjustable based on how they configure it at run time.
Some devices are hard coded to other parameters then 8N1, 7E1.... I'm trying to be able to support working with them.
Thanks.
Post Edited (StampUSR) : 9/7/2005 9:32:33 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Again, that doesn't solve the problem. The parameters I'm using aren't fixed at compile time. They are configurable by the user for whatever they need it to be with regards to baud rate and selectable between 8N1 and 7E1.... and I'm hoping to extend that.
So I guess the obvious answer to my question is that there is no example code for bit blasting RS232 with a Stamp.
Thanks.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sorry, meant 7O1... the two that were supported by the Stamp already. I wanted to add support for parity with 8 data bits.
"Why could you not code the various routines into the SX and call them as required?"
I could probably send commands to the SX from the Stamp to configure it for the output it would use. But then I could just use an actual UART and get the same thing without having to code another processor.
But either way is a new hardware design. I was trying to keep this in software if possible.
Thanks.
What you're attempting is called "autobauding" and I can't think of any way to do it without an external device using a Stamp. Using an external device (an 8 pole dip switch and shift register) you can do it with 2 Stamp pins.
Microchip has applications notes for doing "autobauding" in assembler with their PIC mirocontrollers, and I have to believe with the virtual UART available on the Ubicom SX chips that someone has done it there as well, although it would have to be done in SX assembler I suspect. The SX/B complier supports both Basic and assembler so that's still a go from that angle.
Regards,
Bruce Bates
No, I am not talking about autobauding. Like I have said they are configurable by the user.
On bootup over an RS232 connection the stamp gives the user an option to enter a configuration menu (at a fixed known baud/parameter) with a timeout of a few seconds if no input/wrong input is received from the user. If the user enters the menu they have the option of setting the baud rate and comm port parameters among other things. When they exit the setup menu (or the initial timeout expires) the stamp then switches to whatever baud/parameters it is configured for and it does its normal run time actions.
This is done/tested/working.
I was looking for the bit-blasting to be able to offer more serial port options then just 7O1, 8N1 support.
Look at using a MAX3100 UART as your serial input device. The parameters can be set in that chip to nearly anything you want. The Stamp uses SHIFTIN to access the data. The MAX3100 also has a built in FIFO buffer which may be helpful at higher baud rates.
Regards,
Bruce Bates