Hi All,
I am receiving non readable character from my set up.
Connection: PC <-> Proto board (master) <---> Slave (Prop DIP on breadboard)
The slave blinks LED and it seems to be working.
But characters I type in PST are coming back strange.
Image:

Image from PST:
Master Loader.spin:
(Calls loader sends bytes from slave to PC and PC to slave)
-------------------------------------------------
Code:
CON
_clkmode = xtal1 + pll8x
_xinfreq = 5_000_000
#1, ErrorConnect, ErrorVersion, ErrorChecksum, ErrorProgram, ErrorVerify
#0, Shutdown, LoadRun, ProgramShutdown, ProgramRun
' Set pins and baud rate for PC comms
PC_Rx = 31
PC_Tx = 30
PC_Baud = 9600
' Set pins and Baud rate for Slaveee comms
Slave_Rx = 1 ' Slaveee DOUT
Slave_Tx = 5 ' Slaveee DIN
Slave_Baud = 9600
LED_PIN = 16
DAT loadme file "Serial_Loopback.binary"
OBJ
PC : "FullDuplexSerial"
Slave : "FullDuplexSerial"
loader : "PropellerLoader"
VAR
long P31, P30, LFSR, Ver, Echo
long stack[50] ' stack space for second cog
pub mainPrg |i
dira[LED_PIN] :=1
outa[LED_PIN] := 1
dira[15] := 1
outa[15] := 1
Delay(1000)
i := loader.Connect( 3,5,1,1,ProgramRun,@loadme ) 'Load
PC.dec(i)
PC.tx(13)
PC.start(PC_Rx, PC_Tx, 0, PC_Baud)
Delay(4000)
outa[LED_PIN] := 0
outa[15] := 0
StartComm 'Pass through
Pub StartComm |i
Slave.start(Slave_Rx, Slave_Tx, 0, Slave_Baud) ' Initialize comms for Slaveee
cognew(Slave_to_PC,@stack) ' Start cog for Slaveee--> PC comms
PC.rxFlush ' Empty buffer for data from PC
repeat
Slave.tx(PC.rx) ' Accept data from PC and send to Slaveee
Pub Slave_to_PC |i
Slave.rxFlush ' Empty buffer for data from Slave
repeat
PC.tx(Slave.rx)
{{ Clock Functions }}
Pub Delay(mS)
'' Delay ring
'' Delay(1000) ' pause 1 second
waitcnt(clkfreq/1000 * mS + cnt)
-------------
Code loaded into slave with eeprom (no xtal) :::: Serial_Loopback.spin
------------------------------------------
Code:
CON
_clkmode = RCFAST
' Set pins and baud rate for PC comms
Mastr_Rx = 31
Mastr_Tx = 30
Mastr_Baud = 9600
Var
long stack[50] ' stack space for second cog
OBJ
Master: "FullDuplexSerial"
Pub Start |i
dira[15] := 1
outa[15] := 1
waitcnt(clkfreq * 4 + cnt)
outa[15] := 0
Master.start(Mastr_Rx, Mastr_Tx, 0, Mastr_Baud) ' Initialize comms
Mastr.rxFlush ' Empty buffer
repeat
Mastr.tx(Mastr.rx)
Bookmarks