Shop OBEX P1 Docs P2 Docs Learn Events
Serial Strings For Timer - Page 2 — Parallax Forums

Serial Strings For Timer

2»

Comments

  • walkboneswalkbones Posts: 30
    edited 2006-12-11 21:24
    Hi Chris,

    Herer is what else EDI had to say, regarding using Hyperterminal to test the timer. Can the Stamp recognize black mask and herat shapes?

    "Make sure to activate the ASCHII ECO and you should see in the monitor: a symbol like black mask followed by address of the sign (01) the actual data and a symbol like a heart shape."··
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-12 01:49
    The things you refer to are actually just values that have that appearance in Hyper Terminal.· Your list doesn’t show those figures so it wouldn’t be possible from here to identify which figure goes with which value but it sounds like it receives a binary value, followed by some ASCII characters, then another binary value.· I think this is one of those things you will have to experiment with.· Knowing the address and data expected can help you pinpoint the data you’re looking for and how many bytes there are in a sequence.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • walkboneswalkbones Posts: 30
    edited 2006-12-13 00:44
    Hi folks,

    In case anyone was following the details of this thread, here is the code that works for "polling" this timer with RS232. It replys with 8 bytes -

    STX=2
    Address 0·= 48
    Address 1 = 49
    Data for the time·if the time was 1111 =
    49
    49
    49
    49
    ETX = 3

    ClockBaud······ CON···· 2063··········· ' 1200 bps True, (18447 is inverted)
    STX············ CON···· 02············· 'Start Of Transmission
    ETX············ CON····· 03············ 'End Of Transmission
    P·············· CON···· 80············· ' Poll

    serStr········· VAR···· Byte(8)······················· ' Make a 8-byte array·

    SEROUT ClockOut, ClockBaud, [noparse][[/noparse]STX, "01", P, ETX]

    SERIN ClockIn, ClockBaud, [noparse][[/noparse]STR serStr\8]··············· ' Get 8-byte string
    DEBUG DEC?· serStr(7)," "·························· ' Display the string
    DEBUG DEC?· serStr(6)," "·························· ' Display the string
    DEBUG DEC?· serStr(5)," "·························· ' Display the string'
    DEBUG DEC?· serStr(4)," "·························· ' Display the string
    DEBUG DEC?· serStr(3)," "·························· ' Display the string
    DEBUG DEC?· serStr(2)," "·························· ' Display the string
    DEBUG DEC?· serStr(1)," "·························· ' Display the string
    DEBUG DEC?· serStr(0)," ",CR·························· ' Display the string

    Turns out that the primary cause of grief, as software guys always say, was "hardware!" related. I had a bad ground on the Max232. Go figure.

    Dan
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-13 15:34
    Dan,
    ·
    ·· I’m glad to see you got it figured out.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.