Loading ...
Sorry, an error occurred while loading the content.

Re: Still having problems communicating at higher baud rates

Expand Messages
  • rhnlogic
    There s still stuff that could be hiding inside the b$ unless you print it out byte-by-byte (asc(mid$(b$,i,1)) Last time I tested the serial port stuff, I
    Message 1 of 7 , May 12, 2006
    • 0 Attachment
      There's still stuff that could be hiding inside the b$
      unless you print it out byte-by-byte (asc(mid$(b$,i,1))

      Last time I tested the serial port stuff, I think it
      was with an iBook plus USB/serial adapter at rates up
      to 38400.

      --- In chipmunkbasicforum@yahoogroups.com, "revffwplay"
      <revffwplay@...> wrote:
      >
      > No, when I print that initial b$ it only gives five or six blank lines
      > and then the asterick. Since my data comes out with two astericks,
      > one on each side of it, I tried putting the same for loop around my
      > data collection, so that the program looks like this now:
      >
      > 90 a$ = "$1RB" + chr$(13) :REM chr$(13) is needed for the board to
      > understand the command
      > 97 d$ = "0" :REM just to make sure I know when it prints the string
      > 100 print #1, a$
      > 130 rem macfunction("wait",0.25) : rem and adequate initial delay
      > 140 while : rem These while-loops allows the data to each be acquired
      > in their own string with minimal time lost.
      > 150 input #2,b$
      > 160 wend b$ = "*" :REM An asterick preceeds the data.
      > 170 while : REM To get the data into one string
      > 180 input #2, c$ : REM to get all the data out.
      > 190 d$ = d$ + c$
      > 270 wend c$ = "*" :REM A second asterick should trail the data.
      > 280 print d$
      > ...
      >
      > Now the program runs on in an infinite loop because it never catches
      > that second asterick. So, I'm assuming that first asterick I catch is
      > actually the second one that trails the data.
      >
      > Thanks,
      >
      > Dan
      >
      > --- In chipmunkbasicforum@yahoogroups.com, "rhnlogic" <rhnlogic@>
      > wrote:
      > >
      > > Looks like you never print out the contents of the first b$ input.
      > > Is anything in it?
      > >
      > > --- In chipmunkbasicforum@yahoogroups.com, "revffwplay"
      > <revffwplay@> wrote:
      > > >
      > > > Hi,
      > > >
      > > > I'm having problems communicating to electronics boards using my
      > > > Chipmunk basic program when the baud rate is higher than 1200
      baud. I
      > > > can only get the astericks back that surround the data, but
      never the
      > > > data. I've tried for loops to pick out the data, but I don't get
      > > > anything except the astericks. My data acquisition looks like this
      > > > (and works at lower baud rates, 1200 and below):
      > > >
      > > > ...
      > > > 90 a$ = "$1RB" + chr$(13) :REM chr$(13) is needed for the board to
      > > > understand the command
      > > > 97 d$ = "0" :REM just to make sure I know when it prints the
      string
      > > > 100 print #1, a$
      > > > 130 rem macfunction("wait",0.25) : rem and adequate initial delay
      > > > 140 while : rem These while-loops allows the data to each be
      acquired
      > > > in their own string with minimal time lost.
      > > > 150 input #2,b$
      > > > 160 wend b$ = "*"
      > > > 170 for i = 1 to 5000 : REM Enough loops to obtain all the data
      > > > reproducibly
      > > > 180 input #2, b$ : REM to get all the data out.
      > > > 190 d$ = d$ + b$
      > > > 270 next i
      > > > 280 print d$
      > > > ...
      > > >
      > > > when d$ is printed all I get at 9600 baud is:
      > > >
      > > > 0*
      > > >
      > > > *
      > > >
      > > > instead of:
      > > >
      > > > 0*
      > > > "some number"
      > > > *
      > > >
      > > > Does anyone have any suggestions?
      > > >
      > > > Thanks,
      > > >
      > > > Dan
      > > >
      > >
      >
    • revffwplay
      Okay, thanks, I ll check that. What processor in the iBook? I just tried my program with a G3 iBook recently and I couldn t locate the USB port with the
      Message 2 of 7 , May 17, 2006
      • 0 Attachment
        Okay, thanks, I'll check that.
        What processor in the iBook? I just tried my program with a G3 iBook
        recently and I couldn't locate the USB port with the
        macfunction("serialpath",n) command. All I could find was the modem
        port.

        --- In chipmunkbasicforum@yahoogroups.com, "rhnlogic" <rhnlogic@...>
        wrote:
        >
        > There's still stuff that could be hiding inside the b$
        > unless you print it out byte-by-byte (asc(mid$(b$,i,1))
        >
        > Last time I tested the serial port stuff, I think it
        > was with an iBook plus USB/serial adapter at rates up
        > to 38400.
        >
        > --- In chipmunkbasicforum@yahoogroups.com, "revffwplay"
        > <revffwplay@> wrote:
        > >
        > > No, when I print that initial b$ it only gives five or six blank lines
        > > and then the asterick. Since my data comes out with two astericks,
        > > one on each side of it, I tried putting the same for loop around my
        > > data collection, so that the program looks like this now:
        > >
        > > 90 a$ = "$1RB" + chr$(13) :REM chr$(13) is needed for the board to
        > > understand the command
        > > 97 d$ = "0" :REM just to make sure I know when it prints the string
        > > 100 print #1, a$
        > > 130 rem macfunction("wait",0.25) : rem and adequate initial delay
        > > 140 while : rem These while-loops allows the data to each be acquired
        > > in their own string with minimal time lost.
        > > 150 input #2,b$
        > > 160 wend b$ = "*" :REM An asterick preceeds the data.
        > > 170 while : REM To get the data into one string
        > > 180 input #2, c$ : REM to get all the data out.
        > > 190 d$ = d$ + c$
        > > 270 wend c$ = "*" :REM A second asterick should trail the data.
        > > 280 print d$
        > > ...
        > >
        > > Now the program runs on in an infinite loop because it never catches
        > > that second asterick. So, I'm assuming that first asterick I catch is
        > > actually the second one that trails the data.
        > >
        > > Thanks,
        > >
        > > Dan
        > >
        > > --- In chipmunkbasicforum@yahoogroups.com, "rhnlogic" <rhnlogic@>
        > > wrote:
        > > >
        > > > Looks like you never print out the contents of the first b$ input.
        > > > Is anything in it?
        > > >
        > > > --- In chipmunkbasicforum@yahoogroups.com, "revffwplay"
        > > <revffwplay@> wrote:
        > > > >
        > > > > Hi,
        > > > >
        > > > > I'm having problems communicating to electronics boards using my
        > > > > Chipmunk basic program when the baud rate is higher than 1200
        > baud. I
        > > > > can only get the astericks back that surround the data, but
        > never the
        > > > > data. I've tried for loops to pick out the data, but I don't get
        > > > > anything except the astericks. My data acquisition looks like
        this
        > > > > (and works at lower baud rates, 1200 and below):
        > > > >
        > > > > ...
        > > > > 90 a$ = "$1RB" + chr$(13) :REM chr$(13) is needed for the board to
        > > > > understand the command
        > > > > 97 d$ = "0" :REM just to make sure I know when it prints the
        > string
        > > > > 100 print #1, a$
        > > > > 130 rem macfunction("wait",0.25) : rem and adequate initial delay
        > > > > 140 while : rem These while-loops allows the data to each be
        > acquired
        > > > > in their own string with minimal time lost.
        > > > > 150 input #2,b$
        > > > > 160 wend b$ = "*"
        > > > > 170 for i = 1 to 5000 : REM Enough loops to obtain all
        the data
        > > > > reproducibly
        > > > > 180 input #2, b$ : REM to get all the data out.
        > > > > 190 d$ = d$ + b$
        > > > > 270 next i
        > > > > 280 print d$
        > > > > ...
        > > > >
        > > > > when d$ is printed all I get at 9600 baud is:
        > > > >
        > > > > 0*
        > > > >
        > > > > *
        > > > >
        > > > > instead of:
        > > > >
        > > > > 0*
        > > > > "some number"
        > > > > *
        > > > >
        > > > > Does anyone have any suggestions?
        > > > >
        > > > > Thanks,
        > > > >
        > > > > Dan
        > > > >
        > > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.