Shop OBEX P1 Docs P2 Docs Learn Events
BS1 code to send calculator managed data to display issues — Parallax Forums

BS1 code to send calculator managed data to display issues

Hello!
Okay, I've managed to write out code which makes of original code ideas to make use of a TI 83Plus calculator:
' {$STAMP BS1}
' {$PBASIC 1.0}

SYMBOL serData = B2
' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  TX              = 0             ' serial output to LCD


' -----[ Constants ]-------------------------------------------------------

SYMBOL  LcdBkSpc        = $08           ' move cursor left
SYMBOL  LcdRt           = $09           ' move cursor right
SYMBOL  LcdLF           = $0A           ' move cursor down 1 line
SYMBOL  LcdCls          = $0C           ' clear LCD (use PAUSE 5 after)
SYMBOL  LcdCR           = $0D           ' move pos 0 of next line
SYMBOL  LcdBLon         = $11           ' turn backlight on
SYMBOL  LcdBLoff        = $12           ' turn backlight off
SYMBOL  LcdOff          = $15           ' LCD off
SYMBOL  LcdOn1          = $16           ' LCD on; cursor off, blink off
SYMBOL  LcdOn2          = $17           ' LCD on; cursor off, blink on
SYMBOL  LcdOn3          = $18           ' LCD on; cursor on, blink off
SYMBOL  LcdOn4          = $19           ' LCD on; cursor on, blink on
SYMBOL  LcdLine1        = $80           ' move to line 1, column 0
SYMBOL  LcdLine2        = $94           ' move to line 2, column 0
Reset:
  HIGH TX                               ' setup serial output pin
  PAUSE 100                             ' allow LCD to initialize
Main:
SEROUT TX, T2400, (LcdBLoff, LcdOn1)
PAUSE 250
'DEBUG serData
SERIN 7, T2400, serData
'DEBUG serData
serData = serData + 1
'DEBUG serDATA
SEROUT 7, T2400, (serData)
SEROUT TX,T2400, (#serData)
'SEROUT TX,T2400, (#serData, CR)
'PAUSE 500
'DEBUG serDATA
'SEROUT TX, T2400, (LcdCls)
GOTO Main
That code unchanged runs properly. But by switching the comments for the two output lines:
'SEROUT TX,T2400, (#serData)
SEROUT TX,T2400, (#serData, CR)

Now attempting to send the program with those changes made causes an error. It thinks there's a need for variables with that one. Would someone confirm that one? (No need to try to run it.)

Comments

  • Try declaring CR:

    SYMBOL CR = 13

  • Mike Green wrote: »
    Try declaring CR:

    SYMBOL CR = 13

    Now it gets baroque. I'm now getting "Error:241-Symbol name invalid or already defined."
  • I wasn't sure whether CR was predefined for the BS1. Apparently it is thus your error message. I can't figure out what's wrong with your statement and I looked in the Manual:

    SEROUT TX,T2400, (#serData, CR)


  • Mike Green wrote: »
    I wasn't sure whether CR was predefined for the BS1. Apparently it is thus your error message. I can't figure out what's wrong with your statement and I looked in the Manual:

    SEROUT TX,T2400, (#serData, CR)

    Correct. But the symbol definition is seen before that line. So now what? Anyway that code was originally written as a proof of concept, to show someone how to connect the TI calculator and have the display show what is happening, without the computer involved with showing us what is happening as per the original program.

    I did manage earlier today to translate it into a BS2 program that does work and display data properly, so that's a solved problem there.

    Thanks Mike.

    Win one, lose one I guess.
Sign In or Register to comment.