Shop OBEX P1 Docs P2 Docs Learn Events
Please Help me again — Parallax Forums

Please Help me again

charlercharler Posts: 8
edited 2006-08-21 15:29 in BASIC Stamp
I use SERIN command but the data i was send is not what i send !!!!
'{$STAMP BS2sx}
'{$PORT COM2}
inpbyte var BYTE
baudmode con 240
 
DIRH = %11111111
OUTH = %10000001
Main:
HIGH 4
SERIN 0,baudmode,Main,[noparse][[/noparse]inpbyte]
 
SEROUT 1,baudmode,10,[noparse][[/noparse]"You have enter ",inpbyte,10,13]
LOW 4
OUTH = inpbyte
DEBUG ? inpbyte
Pause 200
Goto Main


My hardware environment



DB 9 pin(s)···················· My BS2SX PIN


pin 2······························ pin 1

pin 3······························ pin 0

pin 5······························ GND


I made my wire by myself and·about 20 cm. long (is that too long?)



after coding and programed to BS2SX , I use Hyper Terminal to send charactor·in sending is O.K. but when i press a key the value is NOT EQUAL ASCII and if i press a lot of time the value is not the same, it's change and change (I notice that it's was missing a first bit and the last bit)



and the terminal doesn't have·a charactor return back.

Comments

  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-20 23:38
    if im not mistaken you can use PIN 16 for serial communication without ripping your serial cable apart..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Learn somthing about everything, and Everthing about somthing-
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-08-21 03:39
    charler,


    willthiswork89 is correct, you can define PIN 16 for serial communication through the existing DBP programming
    connector. Keep in mind there is a signal inversion that takes place when you do this. That said, this could be
    the source of your problem. Since you are using a BS2sx, a baudmode of 240 translates to 9600 baud. Try
    adding 16384 to this value so that the data sent or received becomes inverted. 16384 + 240 = 16624

    You also need a 22K current limiting resistor on your Serin pin...

                    22K
    DB9 pin3 ------/\/\----- BS2 pin 0
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • charlercharler Posts: 8
    edited 2006-08-21 15:29
    Thank you.

    I'm a programmer but some reason make me shift to do this job. My electric (electronic) knowledge is very very necessary.

    I hope i will disturbing you more and more.


    thank again for knowledge and help.
Sign In or Register to comment.