Shop OBEX P1 Docs P2 Docs Learn Events
sx28 + Pink +example — Parallax Forums

sx28 + Pink +example

KiwiKiwi Posts: 85
edited 2006-04-12 14:47 in General Discussion
hello,

a user of this forum AND, was looking for some more info about the sx program

a have made some comments into the sx file

if somebody else can also take a look into that program, and figure out why i have to make some strange programming when i want to receive some data

kurt

i can't upload the html file for the pink server

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 08:14
    At the start of the interrupt code you have
    interrupt bank isrMultiplex
    inc isrmulti
    mov w,isrmulti
    jmp pc+w
    jmp isrthread1
    jmp isrthread2

    You must alter the value in w to be either 0 or 1 (or jmp pc+w goes beyond jumptable)
    interrupt bank isrMultiplex
    inc isrmulti
    mov w,isrmulti
    and······· w,#1
    jmp pc+w
    jmp isrthread1
    jmp isrthread2
    Edit: sorry, didn't notice you reset isrmulti to 255 in thread2. That works too but takes more code.
    regards peter


    Post Edited (Peter Verkaik) : 4/12/2006 8:22:59 AM GMT
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 08:42
    In your mainloop
    · call @get_byte ;received the byte from location "00"
    mov cmd,byte
    call @get_byte ;dummy for cls?? i don't know why , but this is working
    mov w,#$00 ;same as the comment above
    call @send_byte ;

    you assume the pink only sends 1 byte after you send it the command !NB0R00
    but the pink transmits all bytes from var00 up to a stored binary 0 (the CLS character).
    So if var00 holds "dog",0 then 4 bytes are returned to the sx.
    Actually, when no CLS is stored in var00, pink continues to send bytes from the
    next variable and so on, until it encounters a binary 0.

    You send a CLS character after you received·two bytes. I assume the CLS character
    terminates the read command but I am not sure about that.

    regards peter
    ·
  • KiwiKiwi Posts: 85
    edited 2006-04-12 11:08
    hello,

    yes i assume it only send 1 byte, because i block the string into the html file (size = 1).

    but i don't know why i have to program it that way.

    i send the read instruction for reading the var00 into the pink,
    then i use a getbyte routine to received that byte,

    and normally that should work, correct,

    but it doesn't i have to program that way, and i don't know the logic of it

    anybody understand way??
    Kurt
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 13:24
    If you program a variable to hold N characters,
    then the sx receives N+1 characters when reading it,
    or if it holds 1 character, the sx receives 2 characters,
    the last character being the CLS character.

    regards peter
  • KiwiKiwi Posts: 85
    edited 2006-04-12 13:39
    yes that i do understand,

    but let say, the pink is sending "kurt",0

    that equals 5 bytes (0 included)

    if i only want to have the first byte "k", I don't care for the "urt",0 ,

    i would just have to run only 1 time my get_byte routine, correct?


    the pink will send first the 'k', which i have received with the get_byte, then continue the processing of that char, but the pink will send the rest anyway 'urt',0. which isn't needed for me to read.

    i hope i am correct so far.

    so why do i have to use more get_byte routines to get it working???

    i am hope your understand what i mean,it isn't easy to explain

    Kurt
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 13:48
    You need to read the extra bytes as well, so the
    byte receive flag (rx_flag) can be reset after you grab a byte
    in the mainline code.
    Just don't use the extra received bytes.

    Edit:
    It also allows you to synchronize with the pink.
    Only after receiving the CLS, you may send another command
    to the pink.

    regards peter


    Post Edited (Peter Verkaik) : 4/12/2006 1:52:21 PM GMT
  • KiwiKiwi Posts: 85
    edited 2006-04-12 14:19
    ok that is why,

    thanks for the help.

    any idea were i can find more info about creating text webpages??
    i used lines from other examples


    Kurt
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 14:33
    Take a look here
    http://home.hetnet.nl/~hans-kuipers/
    Select HTML/CSS in the upper left corner.
    You can online create several layouts.
    Right-click in the layout window to show source.

    regards peter
    ·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 14:47
    And here is a free tutorial
    http://www.webdesignfromscratch.com/
    regards peter
    ·
Sign In or Register to comment.