Raspberry Pi Serial Port running Pico
Neil Warwick (2650) 1 post |
Hello, This is my first post, so I hope that I’ve put it in the right place. I’m running Pico on a Raspberry Pi and would like to use serial communication to control a Poloku Serial Servo controller. However, I’m struggling to get Basic to persuade the Pi to send any serial data. OS_SerialOp doesn’t appear to be having any effect. Could someone post an example piece of code that I can copy or at least point me in the right direction? Many thanks Neil |
Uwe Kall (215) 120 posts |
As the serial port is sometimes used as a debug-output for porting, it might be that this port is not accessible from pico, but I am not sure. About availability, ROOL should know – anybody? |
Tank (53) 375 posts |
The serial port is not implemented in RISC OS on the Pi yet and does, as you say, output debug info. This is normally only at boot, so the hardware could be used at other times. To do so you could use This The serial port on the Pi is only 3v3, so you need to add an interface chip to get to 5V. |
David (2822) 6 posts |
Tank – I have not used RISCOS since about 1993 so I am rusty, I have tried to get the Pi serial port working. What do you mean by “use the PiSerial module from !SerialDev.Modules.PiSerial.Modules” – what am I supposed to do with it? |
Raik (463) 2061 posts |
I never try it with my Pi but for xM, Panda and MX6 I use the blockdriver and “merge in” the right serial module… so PiSerial for the RPi I think. |
David (2822) 6 posts |
Raik – I take it you are familiar with Tank’s module, isn’t that what RMload PiSerial does? |
Colin (478) 2433 posts |
Here’s a demo program I have (PiSerialTerm.zip) which works on a pi and creates a simple terminal in a taskwindow using the serial block drivers. Unfortunately |
David (2822) 6 posts |
Colin – Thank you for the PiSerialTerm link. When I first tried it, it didn’t work but the next day it did and so did my code. Memo to self – test hardware after a power-on boot not after a reset. Tank – I am using PiSerial to send commands to a Zero-2 robot which I created back in 1984. The Pi is fitted with a Max 3232 and D9 and the system checked by sending commands to WindowsXP running Bray’s Terminal. 2 – it seems to me SYS “PiSerial_TX”,,byte% doesn’t add to bytes in the buffer but overwrites anything still there. Am I doing something wrong? |
Chris Hall (132) 3554 posts |
I don’t think there is any handshaking so stuff will get lost? |
Tank (53) 375 posts |
David, I have tested the module on my setup, and it also has this problem talking to a PC… |
David (2822) 6 posts |
Chris – it is impossible for Zero2 to loose bytes since the outputs from the UART directly drive logic electronics. The PC has a large serial buffer which at 4800 baud when the data is simply printed to the screen by a Terminal program is virtually impossible to fill and it would never repeatedly ‘loose’ 143 bytes. |
David (2822) 6 posts |
Tank – Thank you for the speedy reply, I have emailed you. |