multiple serin/serout items


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kenpo View Post
    ok, how would I send an array of a variable via hyperterminal? is it possble? I haven't used variable arrays in pbp before, only in other languages.

    maybe the best question is: how would you do it?
    if you wanted to have 3 sets of date sent, how would you send it, and make sure they don't get mixed up. ie, what if one set doesn't get sent, I don't want things getting out of synch after 1 month of contnuos usage... it would be cool to send it all at once as an array, but I'd have no idea how to do that via the windows end, so for now, I'm sticking to sending one at a time
    How would I do it?
    I would write a quick program in VB6 (others will say to use VC+, C#, whatever, I use VB6 'cause I know it well and it works for me, so whatever works for you) for the PC end of things to run the serial port, pick a byte sequence to be a leader (preferably 2 bytes that I would be reasonably sure wouldn't be used in the data payload), maybe add in a 'sequence' number to keep everything lined up, send the data, 1, 2, 3, then a checksum byte (or word, whatever), and maybe a trailer byte pair if needed.

    At the PIC end, I would receive the data in a single SERIN statement into my variables, check the leader bytes are correct, check the 'sequence' number against the last one received, keep the data for the time being, do my error detection/checksum, check the trailer byte pair, then put the data where I needed it if all checks out ok.

    Not very difficult stuff...usually. Sometimes you just gotta break it down into smaller chunks because the overall chunk almost looks daunting.
    I'd just work on sending one or two bytes at a time, get used to sending stuff, maybe some error detection, etc...then work my way up to the big stuff.

  2. #2
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    46


    Did you find this post helpful? Yes | No

    Default

    cool, thanks dude, that's what I had in mind then. except I was thinking either C or vb.net

    for now acctually just php/mysql on the pc end connected to the serial port.

Similar Threads

  1. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. Multiple PIC programming
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th May 2007, 23:47
  3. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 17:02
  4. Multiple Pics to One serial port
    By Rleonard in forum Serial
    Replies: 1
    Last Post: - 18th January 2007, 18:30
  5. Using Multiple EEPROMs
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th March 2005, 07:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts