' ' simple smart pin serial demo for P2 Eval board ' CON oscmode = $010c3f04 freq = 160_000_000 baud = 2_000_000 port = 0 OBJ ser: "CogSerial.spin2" PUB demo | c clkset(oscmode, freq) ser.start(63, 62, 0, baud) 'ser.start2(63, 62, 0, baud, 1, 0, 0, baud) 'ser.start2(-1, -1, -1, -1, 63, 62, 0, baud) ser.str(string("Hello world",13,10), port) ser.hex($abcd,7,0, port) ser.tx(13, port) ser.tx(10, port) repeat c := ser.rx(port) 'either or 'if (c:=ser.rxcheck)>-1 'either or ser.tx(c,port) ser.tx(c,port) ser.tx(c,port) ser.tx(13, port) ser.tx(10, port)