Author Topic: p232 chip control problem  (Read 60 times)

suricato

  • Newbie
  • *
  • Posts: 3
p232 chip control problem
« on: Yesterday at 03:16:01 pm »
Hi, i'm using p232 chip by raspberry cm4, i'm using /dev/ttyAMA1 serial, the test code is for example: 

import serial
import time

ser = serial.Serial(
    "/dev/ttyAMA1",
    baudrate=19200,
    timeout=2
)

# Attendi che il P232 sia pronto (15 secondi da power-up)
print("Aspetto la risposta iniziale dal P232...")
time.sleep(15)
data = ser.read(64)
print("Inizializzazione:", data)

# Manda un comando valido (dipende dal firmware)
ser.write(b'LEVEL\n')
time.sleep(0.5)
response = ser.read(128)
print("Risposta:", response)

ser.close()

no reply from p232 chip,attached there is the board schematic, the raspberry cm4 uart are DSP_UART0_RDS_TX, and DSP_UART0_RDS_RX

the p232 chip doesn't work, i don't understand that

Jan

  • Hero Member
  • *****
  • Posts: 1254
Re: p232 chip control problem
« Reply #1 on: Yesterday at 03:55:15 pm »
The p232 mcu integration is seamless. Unfortunately, you probably skipped the LED indicators in your circuit so you made the diagnostics unnecessarily complicated. With the LED indicators, determining the operating status is immediate.

Thus you need some diagnostic tools to verify that the chip is wired well and operating. For example you may measure the DA7 digital output frequency (57 kHz). Or you may attach logic analyzer to TX1, it sends firmware version on power-up. Or you may connect RDS decoder to the analogue output. Or you may connect I2C analyzer to the I2C bus, there's lively communication after power-up.

Once you verify anything of the above, we may continue.

suricato

  • Newbie
  • *
  • Posts: 3
Re: p232 chip control problem
« Reply #2 on: Yesterday at 11:47:58 pm »
Hi,
My problem is above all because the chip does not respond to the message sent via the uart connected to RX2,TX2

suricato

  • Newbie
  • *
  • Posts: 3
Re: p232 chip control problem
« Reply #3 on: Yesterday at 11:57:01 pm »
Hi,
my doubt is whether the fact that the p232 chip is powered by 5v and the raspberry pi cm4 by 3.3v could create problems

Jan

  • Hero Member
  • *****
  • Posts: 1254
Re: p232 chip control problem
« Reply #4 on: Today at 03:14:06 am »
Please see parameters VIL and VIH in the device pdf.

If you use 5V power supply for the chip, at least a simple voltage level converter is required for 3V3 RX line:

VL = 3V3, VH = 5V


Also, I have doubt about the command ser.write(b'LEVEL\n') in your script. \n is usually equivalent to 0x0A. In such case you must use \r which is a correct carriage-return character (0x0D). See the P232 RDS Encoder Technical Manual for detailed info about the ASCII communication format.