Shop OBEX P1 Docs P2 Docs Learn Events
baudmode for 115200 baudrate. — Parallax Forums

baudmode for 115200 baudrate.

jeffrey8860jeffrey8860 Posts: 9
edited 2009-11-19 15:43 in BASIC Stamp
Hi, Good Morning
I'm currently doing a project using BS2 to send sms message thru' a teltonika modem. When using hyperterminal, the baud rate is set to 115200 and text messages can be send out to the target handphone. I have use MAX232 to interface between the BS2 serial com to the modem.

What should be the baudmode for a baud rate of 115200 when using the serout command.? The basic commands manual only display baudmode from T2400 to N4800. Can BS2 support higher baud rate ?. I'm using a PICAXE programming editor mode 08M and option at 4MHz . Please advise. Thank You.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-18 17:26
    A BS2 can't handle 115200 Baud. The fastest it can transmit is 19200 Baud and the fastest it can receive consistently is 9600 Baud.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-10-20 08:39
    The teltonika modem can only send sms at 115200 baud rate when·using the hyper terminal.I tried selecting other baud rate but it displays garbage.Would putting delay to slow down transmission helps?·Please help. Thank you.·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-20 13:21
    You'll have to check the modem documentation, but often these devices come set to a particular Baud, but have a command to change the Baud to some other value. You'd have to use Hyperterminal or something like it to change the Baud to 9600, then you could use this modem with a Stamp.

    If you find that there's no way to change the Baud to something slower, then you'll have to use something like a Propeller which can handle rates that fast.

    A delay wouldn't help. The problem is that the individual bits come too fast.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-20 16:29
    I you don't need to receive at 115.2Kbaud — only transmit — the BS2p, BS2px, or BS2sx will work for you.

    -Phil
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-10-23 11:59
    I have change the baud rate of the modem from 115200 to 2400. I use an oscilloscope to monitor·the·signals at the Tx and Rx of the MAX232 chip and they looks fine.However, no sms·was received at the target handphone.

    The·hyper terminal requires a control-z to end the text message but I·have·use ascii code $03·(end of text)·as I couldn't find control-z in the ascii table. Anyone knows of any alternative ascii code to end text besides control-z.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-23 13:53
    If hyperterminal requires a control-Z to end a text message, then that's what you need.

    control-A is $01, control-B is $02, control-C is $03, and so on. control-Z is $1A.

    If you continue to have problems, you really need to show a drawing of the connections you are using and, if you're using the BS2 at the time, include the source file of your program. Use the "Post Reply" button and attach your files using the Attachment Manager.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-10-25 00:11
    Dear Mr Green, I tried using $1A for control-z to end text and also swapping the Tx and Rx but still cant work.Attached is the·source code, MAX232 circuit, and the hyperterminal commands which can successfully send out text messages.Thank you for your help. Really appreciate it.·
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-10-25 01:02
    If the comms are via MAX232 then you should use True baudmodes.·

    (Inverted baudmodes are for when one end is RS232 'compliant' and the other is TTL/CMOS.)
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-10-25 15:52
    Hi,what is the symbol to represent ascii code? Pg 76 of the manual says # symbols allows ascii output but it shows error when I run the source code·using #1A·. $22 is hex ascii code for "··. Is there any error in the source code below? It shows download successful but I am not so sure about the ascii code symbol.

    main:
    label_14:·if pin1=1 then label_14

    ··serout 0,T2400,("AT+CMGF=1",CR)
    ··pause 2000
    ··serout 0,T2400,("AT+CSCA=",$22,"+6598540020",$22,CR)
    ··pause 2000
    ··serout 0,T2400,("AT+CMGS=",$22,"+6592296522",$22,CR)
    ··pause 2000
    ··serout 0,T2400,("hi",$1A)

    ··goto label_14
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-25 16:14
    First of all, you're using BS1 syntax for the SEROUT statement by using parentheses yet you say you're using a BS2. Use "[noparse][[/noparse]" and "]" instead. Also keep in mind that "T2400" is predefined for the BS1, but has to be declared as a constant for the BS2. See the description of the SEROUT statement in the Stamp Manual or Stamp Editor help files for details.

    Other than that, what you've given looks ok. You're using Stamp 2.0 syntax in the IF statement which is a hold over from the BS1. There is a "fancier" syntax available (Stamp 2.5) described in the Manual.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-10-26 05:22
    When I used "[noparse][[/noparse]" to replace "(", it shows
    Compile Error...
    Error: Illegal character: ('[noparse][[/noparse]' (0x5B))
    OK
    By the way, I'm using 08-M PICAXE microcontroller. The maximum baud rate using serout is 2400. 08-M is programmed using PBASIC.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-26 07:51
    This isn't a forum for the PICAXE. It's reserved for users of Parallax products. When you choose to use a real BASIC Stamp, come back, and we'll be more than happy to assist you.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2009-10-26 13:37
    @jeffrey8860 - Unfortunately, what you're using for programming only looks like PBasic and an old version of PBasic besides. Phil is correct, but the underlying reason for his comment is that these are different products that happen to (deliberately) look similar, but they are different in significant ways. In any event, we can help you with problems regarding Parallax products, but we can't advise you on programming and other problems regarding the PICAXE. You'll have to talk to their support people.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-11-11 08:50
    I have bought a parallax RF transmitter #27980 and RF receiver #27981. Anyone use them before? What are the command to use.The manual says it is 500 ft point of sight. Is it using IR or RF?<!-- / message -->
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-11 15:43
    Have you read the documentation? Like almost all Parallax products, there are links to documentation and sample code on the Parallax webstore page for the product.

    The receiver and transmitter do not use commands. The transmitter has a logic input pin and, when that is high, the transmitter is on. When it's low, the transmitter is off. The receiver has a logic output pin which is high when it receives a signal and low when there's no signal detected. Normally the transmitter is controlled by an asynchronous serial datastream (like from a SEROUT statement) and the receiver is used with a SERIN statement. See the documentation and sample code for details.

    These are RF modules. They use RF for communications.

    The 500 ft range is "line of sight". It's when the receiver has a clear "view" of the transmitter and represents a best case situation. Any obstacles in the way like trees, rain, buildings, walls, etc. will absorb some of the signal and reduce the range.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-11-12 08:38
    I use this source code from parallax RxCode_v_1.0.bs1·and connect the RF Receiver to IN1 of the microcontroller. The debug panel shows·data at w1 and w2·when i didn't even connect the RF Transmitter at the other microcontroller.·It keep sending out sms non stop.Not sure if it is·receiving stray signals·or the Rx is too sensitive to interference.

    start:
    SYMBOL x = W1
    SYMBOL y = W2
    serin 1,N2400,("!"),B3,B2,B5,B4
    DEBUG
    /***below is a working source code to send out sms

    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-12 15:06
    If you look at the corresponding transmit code, you'll see that it turns on the transmitter briefly before starting to send data. This is important. Make sure your code does it.

    It's normal for the receiver to respond to noise when the transmitter is not transmitting. The transmitted signal overrides much of the noise. Unless the transmitter is running all the time, there will always be some noise and some errors, particularly when the receiver is not close to the transmitter. That's why it's important to include some error checking in your code.
  • jeffrey8860jeffrey8860 Posts: 9
    edited 2009-11-19 08:43
    Are you refering to PULSOUT command. I·download this source code to the Tx but still doesn't work.

    'BASIC converted from flowchart:
    'Untitled Flowchart:1
    'Converted on 11/5/2009 at 15:40:44
    main:
    High 0
    Pause 150
    label_14:·if pin1=1 then label_14
    SYMBOL x = w1
    SYMBOL y = w2
    PULSOUT 1, 300
    serout 1,N2400,("!",B3,B2,B5,B4)
    Pause 150
    x = x+1
    y = y+1
    Pause 150
    GOTO label_14
  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-19 15:43
    I don't understand what you're doing. First you set pin 0 to high, then you test pin 1 to make sure it's low, then you use pin 1 as an output for the "sync" pulse and 4 bytes of data (x and y).

    What's connected to those I/O pins? When you say "doesn't work", what do you mean?
Sign In or Register to comment.