Shop OBEX P1 Docs P2 Docs Learn Events
fifo serial input ? — Parallax Forums

fifo serial input ?

ArchiverArchiver Posts: 46,084
edited 2004-03-30 02:44 in General Discussion
I am fairly new to the stamp(BS2-IC) and have been experimenting with
SERIN and am now trying to construct a serial data logger.

i am planning on using a PIC fifo buffer (as described in
files/buffer.txt from 'steve_in_nevada') then passing the data
through the stamp outputting the string to a serial LCD before
storing the data on an eeprom in a .csv format.

i understand about clocking the data in to the stamp, byte by byte
with flow control, but as i will be logging a mixed length string
with a format of i.e. <STX>0123456789<CR> i am looking for a way to
recognise when i have clocked in the <CR> character.
this is a standard suffix on the barcode or RFID scanners that i use
and i want to use the character to signal when to stop clocking in
data and then enable the write to the LCD and eeprom.

anybody got any ideas and / or code for this or is it a little too
ambitious?

best regards

steve

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-03-25 18:05
    On 25 Mar 04 at 3:48, steve wrote:

    > ...i am planning on using a PIC fifo buffer (as described in
    > files/buffer.txt from 'steve_in_nevada') then passing the data
    > through the stamp outputting the string to a serial LCD before
    > storing the data on an eeprom in a .csv format.

    An excellent choice ;-)

    > i understand about clocking the data in to the stamp, byte by byte
    > with flow control, but as i will be logging a mixed length string
    > with a format of i.e. <STX>0123456789<CR> i am looking for a way to
    > recognise when i have clocked in the <CR> character. this is a
    > standard suffix on the barcode or RFID scanners that i use and i
    > want to use the character to signal when to stop clocking in data
    > and then enable the write to the LCD and eeprom.

    This ought to be pretty close to what you need:

    '{$STAMP BS2}
    serin_pin CON 0
    baud CON 84
    fc_pin CON 1

    bar_code VAR Byte(10)

    SERIN serin_pin\fc_pin,baud,[noparse][[/noparse]STR bar_code\10\CR]

    Or, you could just clock the bytes in one at a time in a loop of
    some kind and check each one for the <CR> ASCII code before looping
    back to read the next.

    Regards,

    Steve
    AKA steve_in_nevada
  • ArchiverArchiver Posts: 46,084
    edited 2004-03-30 02:44
    Steve, appreciate the advice.
    i went back and re-read the SERIN command in the manual and had
    an "Oh Yeah!" moment. it all suddenly made sense

    thanks, now i have something i can play with

    regards

    steve

    On 25 Mar 04 at 3:48, steve wrote:

    > ...i am planning on using a PIC fifo buffer (as described in
    > files/buffer.txt from 'steve_in_nevada') then passing the data
    > through the stamp outputting the string to a serial LCD before
    > storing the data on an eeprom in a .csv format.

    An excellent choice ;-)

    > i understand about clocking the data in to the stamp, byte by byte
    > with flow control, but as i will be logging a mixed length string
    > with a format of i.e. <STX>0123456789<CR> i am looking for a way to
    > recognise when i have clocked in the <CR> character. this is a
    > standard suffix on the barcode or RFID scanners that i use and i
    > want to use the character to signal when to stop clocking in data
    > and then enable the write to the LCD and eeprom.

    This ought to be pretty close to what you need:

    '{$STAMP BS2}
    serin_pin CON 0
    baud CON 84
    fc_pin CON 1

    bar_code VAR Byte(10)

    SERIN serin_pin\fc_pin,baud,[noparse][[/noparse]STR bar_code\10\CR]

    Or, you could just clock the bytes in one at a time in a loop of
    some kind and check each one for the <CR> ASCII code before looping
    back to read the next.

    Regards,

    Steve
    AKA steve_in_nevada
Sign In or Register to comment.