Having trouble understanding serial data and fullduplex objects
hello
can anyone help me i moved from a bs2 chip to the propeller chip and on my bs2 boards i had my RF·TX and RX units working. i also have a lcd that i have working on the propeller using simple_serial object but i want to learn how i can move to the full duplex object.
can anyone help me i moved from a bs2 chip to the propeller chip and on my bs2 boards i had my RF·TX and RX units working. i also have a lcd that i have working on the propeller using simple_serial object but i want to learn how i can move to the full duplex object.

Comments
Second, compare the two lists. You'll find that most of them are identical. "init" in one is called "start" in the other. "finalize" in one is called "stop" in the other. FullDuplexSerial's "start" method has a mode parameter which is explained in the comments. Inverted mode is specified differently and FullDuplexSerial doesn't use -1 for an unused pin.
Now, after looking at the two, what don't you understand?
CODE Below //// i get an error on all putc
''**************************************** ''* Parallax Serial LCD Driver v1.2 * ''* Authors: Jon Williams, Jeff Martin * ''* Copyright (c) 2006 Parallax, Inc. * ''* See end of file for terms of use. * ''**************************************** '' '' Driver for Parallax Serial LCDs (#27976, #27977, #27979) '' '' v1.2 - March 26, 2008 - Updated by Jeff Martin to conform to Propeller object initialization standards. '' v1.1 - April 29, 2006 - Updated by Jon Williams for consistency. '' '' '' Serial LCD Switch Settings for Baud rate '' '' ┌─────────┐ ┌─────────┐ ┌─────────┐ '' │ O N │ │ O N │ │ O N │ '' │ ┌──┬──┐ │ │ ┌──┬──┐ │ │ ┌──┬──┐ │ '' │ │[noparse][[/noparse]]│ │ │ │ │ │[noparse][[/noparse]]│ │ │ │[noparse][[/noparse]]│[noparse][[/noparse]]│ │ '' │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ '' │ │ │[noparse][[/noparse]]│ │ │ │[noparse][[/noparse]]│ │ │ │ │ │ │ │ '' │ └──┴──┘ │ │ └──┴──┘ │ │ └──┴──┘ │ '' │ 1 2 │ │ 1 2 │ │ 1 2 │ '' └─────────┘ └─────────┘ └─────────┘ '' 2400 9600 19200 CON LCD_BKSPC = $08 ' move cursor left LCD_RT = $09 ' move cursor right LCD_LF = $0A ' move cursor down 1 line LCD_CLS = $0C ' clear LCD (follow with 5 ms delay) LCD_CR = $0D ' move pos 0 of next line LCD_BL_ON = $11 ' backlight on LCD_BL_OFF = $12 ' backlight off LCD_OFF = $15 ' LCD off LCD_ON1 = $16 ' LCD on; cursor off, blink off LCD_ON2 = $17 ' LCD on; cursor off, blink on LCD_ON3 = $18 ' LCD on; cursor on, blink off LCD_ON4 = $19 ' LCD on; cursor on, blink on LCD_LINE0 = $80 ' move to line 1, column 0 LCD_LINE1 = $94 ' move to line 2, column 0 LCD_LINE2 = $A8 ' move to line 3, column 0 LCD_LINE3 = $BC ' move to line 4, column 0 #$F8, LCD_CC0, LCD_CC1, LCD_CC2, LCD_CC3 #$FC, LCD_CC4, LCD_CC5, LCD_CC6, LCD_CC7 VAR long lcdLines, started OBJ ' serial : "simple_serial" ' bit-bang serial driver fld : "FullDuplexSerial" ' Full Duplex Serial Controller PUB start(pin, baud, lines): okay '' Qualifies pin, baud, and lines input '' -- makes tx pin an output and sets up other values if valid started~ ' clear started flag if lookdown(pin : 0..27) ' qualify tx pin if lookdown(baud : 2400, 9600, 19200) ' qualify baud rate setting if lookdown(lines : 2, 4) ' qualify lcd size (lines) if fld.start(-1,0, pin, baud) ' tx pin only, true mode lcdLines := lines ' save lines size started~~ ' mark started flag true return started PUB stop '' Finalizes serial object, disable LCD object if started fld.stop started~ ' set to false PUB tx(txByte) '' Transmit a byte fld.tx(txByte) PUB str(strAddr) '' Transmit z-string at strAddr fld.str(strAddr) PUB cls '' Clears LCD and moves cursor to home (0, 0) position if started putc(LCD_CLS) waitcnt(clkfreq / 200 + cnt) ' 5 ms delay PUB home '' Moves cursor to 0, 0 if started putc(LCD_LINE0) PUB gotoxy(col, line) | pos '' Moves cursor to col/line if started if lcdLines == 2 ' check lcd size if lookdown(line : 0..1) ' qualify line input if lookdown(col : 0..15) ' qualify column input putc(LinePos[noparse][[/noparse]line] + col) ' move to target position else if lookdown(line : 0..3) if lookdown(col : 0..19) putc(LinePos[noparse][[/noparse]line] + col) PUB clrln(line) '' Clears line if started if lcdLines == 2 ' check lcd size if lookdown(line : 0..1) ' qualify line input putc(LinePos[noparse][[/noparse]line]) ' move to that line repeat 16 putc(32) ' clear line with spaces putc(LinePos[noparse][[/noparse]line]) ' return to start of line else if lookdown(line : 0..3) putc(LinePos[noparse][[/noparse]line]) repeat 20 putc(32) putc(LinePos[noparse][[/noparse]line]) PUB cursor(type) '' Selects cursor type '' 0 : cursor off, blink off '' 1 : cursor off, blink on '' 2 : cursor on, blink off '' 3 : cursor on, blink on if started case type 0..3 : putc(DispMode[noparse][[/noparse]type]) ' get mode from table other : putc(LCD_ON3) ' use serial lcd power-up default PUB displayOff '' Blank the display (without clearing) if started putc(LCD_OFF) PUB displayOn '' Restore the display (with cursor hidden) if started cursor(0) PUB custom(char, chrDataAddr) '' Installs custom character map '' -- chrDataAddr is address of 8-byte character definition array if started if lookdown(char : 0..7) ' make sure char in range putc(LCD_CC0 + char) ' write character code repeat 8 putc(byte[noparse][[/noparse]chrDataAddr++]) ' write character data PUB backLight(status) '' Enable (true) or disable (false) LCD backlight '' -- works only with backlight-enabled displays if started status := status <> 0 ' promote non-zero to -1 if status putc(LCD_BL_ON) else putc(LCD_BL_OFF) else status := false return status DAT LinePos byte LCD_LINE0, LCD_LINE1, LCD_LINE2, LCD_LINE3 DispMode byte LCD_ON1, LCD_ON2, LCD_ON3, LCD_ON4 {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}the method
keeps it's name as it is INSIDE the file and not a method in the FDX-object-file
you changed its name to Pub Tx(TxByte)
best regards
Stefan
Post Edited (StefanL38) : 10/30/2009 10:04:19 PM GMT
''**************************************** ''* Debug_Lcd v1.2 * ''* Authors: Jon Williams, Jeff Martin * ''* Copyright (c) 2006 Parallax, Inc. * ''* See end of file for terms of use. * ''**************************************** '' '' Debugging wrapper for Serial_Lcd object '' '' v1.2 - March 26, 2008 - Updated by Jeff Martin to conform to Propeller object initialization standards. '' v1.1 - April 29, 2006 - Updated by Jon Williams for consistency. '' OBJ lcd : "serial_lcd" ' driver for Parallax Serial LCD num : "simple_numbers" ' number to string conversion bs2 : "BS2_Functions" ' BSE functions for the transiver and recive fld : "FullDuplexSerial" ' BSE functions for the transiver and recive PUB start(rxpin, txpin, mode, baudrate) : okay '' Initializes serial LCD object '' -- returns true if all parameters okay okay := fld.start(rxpin, txpin, mode, baudrate) PUB stop '' Finalizes lcd object -- frees the pin (floats) fld.stop PUB tx(txbyte) '' Send a byte to the terminal fld.tx(txbyte) PUB str(strAddr) '' Print a zero-terminated string fld.str(strAddr) PUB dec(value) '' Print a signed decimal number fld.str(num.dec(value)) PUB decf(value, width) '' Prints signed decimal value in space-padded, fixed-width field fld.str(num.decf(value, width)) PUB decx(value, digits) '' Prints zero-padded, signed-decimal string '' -- if value is negative, field width is digits+1 fld.str(num.decx(value, digits)) PUB hex(value, digits) '' Print a hexadecimal number fld.str(num.hex(value, digits)) PUB ihex(value, digits) '' Print an indicated hexadecimal number fld.str(num.ihex(value, digits)) PUB bin(value, digits) '' Print a binary number fld.str(num.bin(value, digits)) PUB ibin(value, digits) '' Print an indicated (%) binary number fld.str(num.ibin(value, digits)) PUB cls '' Clears LCD and moves cursor to home (0, 0) position fld.cls PUB home '' Moves cursor to 0, 0 fld.home PUB gotoxy(col, line) '' Moves cursor to col/line fld.gotoxy(col, line) PUB clrln(line) '' Clears line fld.clrln(line) PUB cursor(type) '' Selects cursor type '' 0 : cursor off, blink off '' 1 : cursor off, blink on '' 2 : cursor on, blink off '' 3 : cursor on, blink on fld.cursor(type) PUB display(status) '' Controls display visibility; use display(false) to hide contents without clearing if status fld.displayOn else fld.displayOff PUB custom(char, chrDataAddr) '' Installs custom character map '' -- chrDataAddr is address of 8-byte character definition array fld.custom(char, chrDataAddr) PUB backLight(status) '' Enable (true) or disable (false) LCD backlight '' -- affects only backlit models fld.backLight(status) {{ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TERMS OF USE: MIT License │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation │ │files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, │ │modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software│ │is furnished to do so, subject to the following conditions: │ │ │ │The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.│ │ │ │THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE │ │WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR │ │COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ │ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ }}Please post all your code. Use the archive function in the Propeller tool (but don't include the tool in the archive).
I have to ask back: do you remember this picture ? archive a project
How many times do you want to make the experience that if you try it superFAST everything turns out superSLOW ?
It took 4 hours until I post this. And now it take some hours more until you read again and another some hours or next day
until the forum analysed your bug.
Your bug has to do with the codeline "lcd.cls"
An original file "serial_lcd.spin" does compile. So YOU must have changed something in the file "serial_lcd.spin"
but you don't provide this file to the forum.
To say it very clear: from your actual knowledge about spin you don't have the oversight where the bug comes from.
So take a few more MINUTES to archive your whole project (WITHOUT propeller.exe !!!!)
best regards
Stefan
Post Edited (StefanL38) : 11/3/2009 6:44:19 AM GMT