Receive serial data


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1

    Default Receive serial data

    Hi all,

    I have built a logger to store temperatures into an eeprom and later at home i dump all values to my PC where i can build graphs and so on.

    My objective is to build an interface with a pic/eeprom/LCD where i can connect to the output of my logger and receive the data and get the math for Max, Min, Avg and check these values on site with the LCD.

    I have almost everything figured up but i'm puzzled in how to receive the data.

    The logger is sending the data with a loop like: reading eeprom at address x, sending that data using the debug line ( with 13,10 at the end to separate the values ) and with a speed of 9600, increment x and loop for next address.

    The result is something like this:

    23
    28
    50
    75
    110
    115
    etc

    My doubt is in how will be the codeline to receive and place each temperature reading in a variable for storage. How to recognize each reading and not mixing or skip any other?

    Thanks
    Rui

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    What is the range of temperatures that you are going to record?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Greetings Skimask

    Long time no talk

    The recorded temperatures from the logger are between 0 and 160șC.

    Thanks
    Rui

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    The recorded temperatures from the logger are between 0 and 160șC.
    1 degree granularity (i.e. 10C 11C) or less than that (i.e. 10.2C 11.547381223430947C)?

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Just 1 degree granularity 10, 11, etc

    .

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ruijc View Post
    Just 1 degree granularity 10, 11, etc
    Well, if it was me, and I wanted close to 100% assurance that my data was good, I guess I'd go a little bit crazy and do something like have a 'packet' of X number of bytes, each packet for one temperature reading for each 'location'...

    packet start ID (example of $FF)
    address X.lowbyte
    address X.highbyte
    data byte
    same data byte (inverted)
    address X.highbyte (inverted)
    address X.lowbyte (inverted)
    packet end ID ($00, which is the packet start ID inverted)

    So, I'd end up with an 8 byte packet, everything is sent, then it's all sent again but inverted at the bit level. The packet start ID might be an $FF (because the temp's will never be that high), the addresses might be that high, but if you got that then the packet end ID wouldn't match up.
    It's a bit overkill, but I don't see why it would work. And really, I think I'd trust my wiring enough to just send a couple of $FF's as a start marker, then the whole recorded memory from start to finish, maybe with a couple of $FF's as an end marker.
    It's all up to you. You get to make RSP... ruijc's serial protocol.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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