Shop OBEX P1 Docs P2 Docs Learn Events
serial data using PIC18F chip and Parallax Internet Netburner kit — Parallax Forums

serial data using PIC18F chip and Parallax Internet Netburner kit

microchip2microchip2 Posts: 5
edited 2010-02-10 21:33 in General Discussion
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-10 17:16
    1) We can't help you with the C code for the PIC18F microcontroller.

    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.
  • microchip2microchip2 Posts: 5
    edited 2010-02-10 20:18
    Thanks,
    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.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-02-10 21:33
    I have seen similar requests in the past before and Mike or someone else has generously offered what we can in terms of help. It does of course help to know how the BASIC Stamp commands work when translating, and that we can help on, however translating into an unsupported language is not possible unless someone on here just happens to know your language and offers the help.

    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
    ·
Sign In or Register to comment.