serial data using PIC18F chip and Parallax Internet Netburner kit
microchip2
Posts: 5
I·am trying to send and receive serial data to the Parallax Internet Netburner Kit. I am using a pic18f microcontroller and have looked at the basic stamp samples. I need to convert the following basic stamp line:
SEROUT TX, Baud, [noparse][[/noparse]"!NB0W01:100", CLS] ' Store ASCII string '100' in variable 01
·
to ccs c code.
·
I have included the following lines in my code.
//sets up rs232 pins
#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,STREAM=NET,TIMEOUT=20,ERRORS)
//outputs a null character string on pin b1.
fputs ("!NB0W01:600",NET);
·
·
I have noticed that the basic stamp code causes the TX line to go low for several milliseconds before the pulses of data is actual sent. Then it returns high.
·
The C code that I am using starts out high then goes immediately to the pulses and then returns high.
·
Is there more information available on how the basic stamp serial data lines work? Is there more detailed information on how the Parallax Internet Netburner works?
·
Post Edited (microchip2) : 2/10/2010 4:05:04 PM GMT
SEROUT TX, Baud, [noparse][[/noparse]"!NB0W01:100", CLS] ' Store ASCII string '100' in variable 01
·
to ccs c code.
·
I have included the following lines in my code.
//sets up rs232 pins
#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,STREAM=NET,TIMEOUT=20,ERRORS)
//outputs a null character string on pin b1.
fputs ("!NB0W01:600",NET);
·
·
I have noticed that the basic stamp code causes the TX line to go low for several milliseconds before the pulses of data is actual sent. Then it returns high.
·
The C code that I am using starts out high then goes immediately to the pulses and then returns high.
·
Is there more information available on how the basic stamp serial data lines work? Is there more detailed information on how the Parallax Internet Netburner works?
·
Post Edited (microchip2) : 2/10/2010 4:05:04 PM GMT
Comments
2) The PINK uses standard logic level asynchronous serial I/O. It uses "true" logic where the serial line idles at logic high. The start bit goes low, then you have the 8 data bits, followed by a stop bit which is a logic high. Remember that any PINK commands that end with a parameter (following a colon) have to have a zero byte as a terminator for the parameter. See the PINK documentation for details.
3) As with most Parallax products, there are links to documentation and sample code on the webstore page for the product.
4) I've only looked at a few sample programs for the BS2 and none of them explicitly cause the TX line to go low for several milliseconds before the data is sent. I expect that what you're seeing is that the I/O pin is initialized to input mode when the Stamp is reset. This may appear to be a logic low if observed with a voltmeter or 'scope, but it's not. When the first SEROUT statement is executed, the I/O pin is changed to output mode, the data is sent, and the I/O pin is left in output mode with its state being a logic high.
5) Unlike the PICs which often have a dedicated hardware serial I/O block, the Stamps have no dedicated hardware. All of the I/O pins are the same and any of them can be used for any function. There are some exceptions in the BS2p models where certain statements use specific I/O pins, but generally the I/O pins are all equivalent. The "BASIC Stamp Syntax and Reference Manual" is downloadable from Parallax's Stamp Downloads webpage and is the primary reference for the Stamps. You'll find descriptions of the various statements including SEROUT and examples of their use.
6) Whatever information is available for the PINK is given on the webstore page for the product. That's what's available.
Has anyone used a pic microchip to send data to the Parallax internet Neburner kit? I will try to replace the existing PIC18F chip since it may have been damage. The signals look ok on the oscilloscope though.
If you have specific questions about what data need to go to the PINK module I would be willing to answer those questions that Mike did not already address. As he mentioned, please check the documentation. The command structure is broken down in more detail there. Take care.
P.S. - What might not be obvious to those who don't use the BASIC Stamp is that the CLS in the SEROUT statement is really a hard-coded constant for 0.· The 0 (as mentioned) must follow the string being sent.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·