Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:51 19 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Raspi 400: serial UART communication

Author Message
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 535
Posted: 06:02am 16 Jun 2021
Copy link to clipboard 
Print this post

Hey

I'm playing with my Raspberry 400 trying to write some bare metal software however, I'm having basic problems trying to read via UART the boot log.

I bought this 3.3v serial to USB cable and I connected it to the Raspi 400 on the 6, 8 and 10 GPIO pins (ground, GPIO 14 and 15). On my computer I used the command screen /dev/ttyUSB0 115200, and also the Putty to try to read the data. I was able to connect the terminal to the ttyUSB0 without problems, but I couldn't receive any data. The screen app kept connected without showing anything.

On the Raspi 400 side, I tried to change the configuration disabling the Bluetooth to allow me to use the UART0. I did this configuration by changing the config.txt adding these two lines: dtoverlay=disable-bt and enable_uart=1

Even with all these config changes, I couldn't read any data from the Raspi.

Has anyone on the forum with experience on Raspberry 4 or 400 that can give me some help?

Thank you so much
Leo
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10609
Posted: 07:00am 16 Jun 2021
Copy link to clipboard 
Print this post

  Quote  Even with all these config changes, I couldn't read any data from the Raspi.


Welcome to the world of I/O on the Raspberry Pi. Another example of why I scrapped the MMBasic port
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 07:05am 16 Jun 2021
Copy link to clipboard 
Print this post

Is this any use, Leo?
https://www.raspberrypi.org/forums/viewtopic.php?t=184718

I've not got a Pi4 or Pi400 so I can't help further.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 535
Posted: 04:01pm 16 Jun 2021
Copy link to clipboard 
Print this post

If Matherp with his experience was struggling with the Raspberry, I can't imagine I fixing the issue

Mixtel, I've tried several combinations and nothing. I don't have an oscilloscope to help me.

I will try to do the same thing on my CMM2. Maybe is a problem with the serial cable.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 04:47pm 16 Jun 2021
Copy link to clipboard 
Print this post

I've had problems in the past using multicore cable for serial TTL if it's over about 0.5m. There's sometimes too much capacitance and it messes the signal up. I try to keep those signals down to 300mm or less.

I got a DSO112A baby 'scope off ebay quite a while ago. It's been really useful, even though it's quite basic (and single channel) - and it was cheap.

You could try a LED and resistor from TXD to ground on the Pi. That should flicker as the log file is sent to the uart. It would prove that you have the right pin fo r the output.
Edited 2021-06-17 06:28 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2831
Posted: 12:50am 17 Jun 2021
Copy link to clipboard 
Print this post

Re TTL serial over multicore cable.
I was able to reliably get 57600 baud two way data with 40 meters of cheap telephone cable. At 115200 there were many errors but not an empty screen.
Arduino's have a LED & resistor on Rx & Tx, which is all you need to check for activity.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 8297
Posted: 06:57am 17 Jun 2021
Copy link to clipboard 
Print this post

It seems to depend a lot on the cable, Phil. I thought I'd make up a nice little USB-TTL programming cable. I made the USB section short because I happened to have a short lead for that, and 600mm of flexible intended for lighting data links in offices.  This sort has the cores side by side, similar to ribbon cable. It was completely useless. I finally got it to work by cutting it back to about 300mm and using a longer USB lead. Ordinary ribbon cable works better.

I don't know how you managed that speed over that distance with TTL. Were you using proper line drivers and receivers? I must admit that I've not attempted anything like that - I've had no need to.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2831
Posted: 01:11pm 17 Jun 2021
Copy link to clipboard 
Print this post

The 40m link was as simple as you can get, a CP2102 USB/TTL at one end with pair 1 used for Rx & Tx and pair 2 wires bridged together for ground, and an MX170 MM2 at the other. The choice of pair 1 for both Tx and Rx may seem odd but 2 pair cable is a special case where the pairs are not twisted individually but as a single group. The wires of pair 1 are diagonally opposite so that for balanced phone circuits crosstalk between the pairs is minimized. TTL serial is unbalanced so I put Tx and Rx as far apart as possible with ground wires in between. For a flat cable use 5 cores if available thus: Gnd.-Tx-Gnd.-Rx-Gnd. The important point is never have Tx and Rx side by side.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025