Shop OBEX P1 Docs P2 Docs Learn Events
FullDuplex Issues — Parallax Forums

FullDuplex Issues

kkumar5kkumar5 Posts: 2
edited 2013-01-17 17:21 in Propeller 1
hello,

I am trying to display text from my PC, via a propeller RPM board to an LCD screen
PC ---serial port
max3232
propeller rpm----LCD

I have even tried this since the board has level sensors on it, but these are on different boards so nothing is fried
PC --- serial port --- propeller -- LCD

I am using the code found here to interface with the board : http://obex.parallax.com/objects/54/
Right now nothing i type into realterm, or hyperterminal and nothing shows up on my screen....Please help

This is my code:

CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
NewLine = 13
ClearScreen = 0
rxpin = 30
txpin = 31
mode = 2
baudrate = 9600


OBJ
VideoDisplay: "TV_Terminal"
XB : "FullDuplexSerial"
'
PUB Start
'
DisplayTextOnMonitor
'
PRI DisplayTextOnMonitor | data

VideoDisplay.start(12) 'Initializes the VideoDisplay object
SetScreenWhiteOnDarkBlue 'Calls a procedure that sets the foreground
' color to white and the background color

XB.start(rxpin, txpin, mode, baudrate)
data := XB.rx


VideoDisplay.out(data)




PRI SetScreenWhiteOnDarkBlue 'Sets the foreground color to white and the
VideoDisplay.out(3) ' background color to dark blue on the monitor.
VideoDisplay.out(5)

Comments

  • Mike GMike G Posts: 2,702
    edited 2010-04-03 00:47
    If your trying to write to an LCD display than use one the of the LCD objects. Writing to a PC Monitor? Use one the the VGA objects. The TV_Terminal outputs to a TV terminal.

    Right tool for the job.

    Post Edited (Mike G) : 4/3/2010 12:52:03 AM GMT
  • Mike GMike G Posts: 2,702
    edited 2010-04-03 00:57
    Also it's probably a good idea to start the your objects in the start method. When you post code please use the code tags. It makes reading the code in the forum easier.

    You might want to read the Propeller manual.

    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000
    NewLine = 13
    ClearScreen = 0
    rxpin = 30
    txpin = 31
    mode = 2
    baudrate = 9600
    
    
    OBJ
    VideoDisplay: "TV_Terminal"
    XB : "FullDuplexSerial"
    '
    PUB Start
    '
      DisplayTextOnMonitor
    '
    PRI DisplayTextOnMonitor | data
    
      VideoDisplay.start(12) 'Initializes the VideoDisplay object
      SetScreenWhiteOnDarkBlue 'Calls a procedure that sets the foreground
      ' color to white and the background color
    
      XB.start(rxpin, txpin, mode, baudrate)
      data := XB.rx
    
    
      VideoDisplay.out(data)
    
    
    
    
    PRI SetScreenWhiteOnDarkBlue 'Sets the foreground color to white and the
      VideoDisplay.out(3) ' background color to dark blue on the monitor.
      VideoDisplay.out(5)
    
  • kkumar5kkumar5 Posts: 2
    edited 2010-04-03 01:26
    I feel like a moron after having fixed my problem

    i had a floating ground issue which was not letting the propeller decode the data right....it took me 5 hours to find it so i paid for my mistake in full

    thansk for the help guys
  • AlarusAlarus Posts: 48
    edited 2013-01-16 23:49
    Why, the 11 bits instead of 10 bits?
    Is not it reduces the Baudrate of transmission?
    transmit                jmpret  txcode,rxcode         'run a chunk of receive code, then return
    
                            mov     t1,par                'check for head <> tail
                            add     t1,#2 << 2
                            rdlong  t2,t1
                            add     t1,#1 << 2
                            rdlong  t3,t1
                            cmp     t2,t3           wz
            if_z            jmp     #transmit
    
                            add     t3,txbuff             'get byte and inc tail
                            rdbyte  txdata,t3
                            sub     t3,txbuff
                            add     t3,#1
                            and     t3,#$0F
                            wrlong  t3,t1
    
                            or      txdata,#$100          'ready byte to transmit
                            shl     txdata,#2
                            or      txdata,#1
                            mov     txbits,#11
                            mov     txcnt,cnt
    
    :bit                    test    rxtxmode,#0  wz    'output bit on tx pin according to mode
                            test    rxtxmode,#0  wc
            if_z_and_c      xor     txdata,#1
                            shr     txdata,#1       wc
            if_z            muxc    outa,txmask        
            if_nz           muxnc   dira,txmask
                            add     txcnt,bitticks        'ready next cnt
    
    :wait                   jmpret  txcode,rxcode         'run a chunk of receive code, then return
    
                            mov     t1,txcnt              'check if bit transmit period done
                            sub     t1,cnt
                            cmps    t1,#0           wc
            if_nc           jmp     #:wait
    
                            djnz    txbits,#:bit          'another bit to transmit?
    
                            jmp     #transmit             'byte done, transmit next byte
    

    Should be replaced by:
                            or      txdata,#$100          'ready byte to transmit
                            shl     txdata,#2
                            or      txdata,#1
                            mov     txbits,#11
                            mov     txcnt,cnt
    
    

    by:
                            or      txdata,#$100          'ready byte to transmit
                            shl     txdata,#1
                            mov     txbits,#10
                            mov     txcnt,cnt
    
  • SRLMSRLM Posts: 5,045
    edited 2013-01-17 03:08
    It's probably 1 start, 8 data, and 2 stop. The double stop bit is to help the receiver get back on track if it's off by a bit.
  • AlarusAlarus Posts: 48
    edited 2013-01-17 03:11
    Should have different modes (8N1 8E1 8O1 8N2 etc.).
  • SRLMSRLM Posts: 5,045
    edited 2013-01-17 10:39
    Alarus wrote: »
    Should have different modes (8N1 8E1 8O1 8N2 etc.).

    Why? In four years of using FDS, I've never come across the need for anything but the default. Can you provide examples of common devices whose only communication is asynchronous serial that is uncommon?

    ps: And you're always free to modify to suit. That's the nice thing about the Propeller hardware: it's all software. You get to choose.
  • AlarusAlarus Posts: 48
    edited 2013-01-17 17:21
    Such as Modbus, requires 8E1 mode. Older terminals require 7N1 mode as they work with ASCII.
Sign In or Register to comment.