1

I have a raspberry pi 3b+, and I am trying to communicated with a TPI synthesizer model 1001-B. I want to use Python and specifically the pyserial module to communicate with a serial port - i.e. the synthesizer, which is connected via USB to the raspberry pi. The synthesizer specifies some particular setting for the python code:

"Internally the communication USB port is connected to an FTDI chip that acts as a USB to UART translator. Therefore, the user’s program accesses the unit as if it was a COM port. The driver installed in the computer maps the computer’s USB port to a virtual COM port. The user’s program must set the COM port parameters to the following… • Baud rate: 3,000,000 (3 Mbit/sec) • Data bits: 8 • Stop bits: 1 • Parity: None • Handshake: Request to send"

The code I tried was:

import serial

ser = serial.Serial( port='/dev/ttyUSB0', baudrate=3000000, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS )

I then ran the following code, hoping to write to the device and enable user control on the device:

ser.write(chr(0xAA) + chr(0x55) + chr(0x00) + chr(0x02) + chr(0x08) + chr(0x01) + chr(0xF4))

I chose this particular set of strings because the user manual specified it. "The full packet including the header and checksum is… 0xAA, 0x55, 0x00, 0x02, 0x08, 0x01, 0xF4" where 0xAA, 0x55, 0x00, 0x02 is the header, 0x08, 0x01 is the body, and 0xF4 is the checksum.

When I did, the device did not write anything back. Any ideas? Can I use pyserial with Linux? Help!

RobyMann
  • 11
  • 1
  • 1
    Ah let me see. (1) So your TPI synthesizer is using a USB to UART/serial/TTL cable/adapter (never mind FTDI, which is not relevant here) to talk to the other side. (2) The other side, in your case Rpi, is of course using serial, either the UART RxD, TxD pins, or also a USB to serial cable to the other side. (3) In other words, TPIS has a USB to serial cable, Rpi also has a serial cable (on board serial, or also USB to serial), and the two serial cables join end to end (Importnat: Rx/TX wires "crossing over") Please let know if I see the picture correctly, before I move on. – tlfong01 Feb 14 '20 at 03:18
  • 1
    Also can you give me the web link to the AT command set, or the user manual that describes the serial spec 3kbd8N1, the AT commands and the package spec: header, body, checksum etc – tlfong01 Feb 14 '20 at 03:22
  • I casually googled and found the following, but no luck with the AT command set:(1) Review: TPI-1001-B RF Synthesizer https://interferencetechnology.com/review-tpi-1001-b-rf-synthesizer/

    (2) TPI-1001-B RF Synthesizer Features https://rf-consultant.com/products/tpi-1001-b-signal-generator/

    (3) TPI-1001-B RF Synthesizer Features YouTube https://rf-consultant.com/products/tpi-1001-b-signal-generator/

    (4) AliBaBa TPI-1001-B - $450 https://www.alibaba.com/product-detail/TPI-1001-B_50021319321.html

    / to continue, ...

    – tlfong01 Feb 14 '20 at 03:52
  • (5) TPI-1001A User Manual - Trinity Power Inductry https://studylib.net/doc/18665149/tpi-1001-a-user-manual---rf – tlfong01 Feb 14 '20 at 03:52
  • BTW, I feel jealous that you have an US$450, 3.5MH to 4.4GHz sig gen, I am playing with 2.4GHz right now and I also have a couple of UART controlled ADxxxx sig gen chips and module, but all are low frequency (2.4GHz or lower). I also have a UART controlled FM receiver. Perhaps the time has come for me to invest US$450 for a new toy :) Reference to my 2.4GHz project https://chat.stackexchange.com/rooms/103645/discussion-on-question-by-stevencellist-rpi-spi-nrf24l01-2-4ghz-transceiver-mod – tlfong01 Feb 14 '20 at 03:57
  • UART controlled devices using AT commands are very similar, except of course in the details of the command format. My usual troubleshooting suggestion is forget about Rpi and python, just use Win10 RealTerm to do manual AT command input, and only start python programming AFTER you find manual testing OK. More references: (1) UART FPV https://raspberrypi.stackexchange.com/questions/105223/how-can-rpi4b-use-uart-to-read-and-analyze-received-data-at-a-3dr-fpv-air-radio – tlfong01 Feb 14 '20 at 06:33
  • (2) UART Projector (Read my commenbts) https://raspberrypi.stackexchange.com/questions/105405/rpi-zero-and-projectors-usb-rs232-serial-cable-interface-connection-problem (3) UART XY Sig Gen https://raspberrypi.stackexchange.com/questions/104779/how-can-rpi4b-python-uart-talk-to-xy-pwm-signal-generators (4) ADS9850 ICL9338 Sig Gen https://raspberrypi.stackexchange.com/questions/96423/pi-hat-waveform-generator-for-raspberry-pi-3b – tlfong01 Feb 14 '20 at 06:33
  • 1
    Run your script on a regular PC. Unless it works, the problem is not related to the Raspberry. – Dmitry Grigoryev Feb 14 '20 at 08:27
  • Hi tlfong01 - thank you for all your comments! I think the link to the user command manual is here: https://www.dropbox.com/sh/75a0aksv1fp84h0/AABzfrecWP7XkKU4qjCvFhmba/Public%20TPI/Documents/Application%20Notes?dl=0&preview=AN_2_TPI_User_Command_Structure_rev_1.15.pdf&subfolder_nav_tracking=1 but it can be found by going through the dropbox link at the bottom of this page for sure: https://rf-consultant.com/products/tpi-1001-b-signal-generator/ – RobyMann Feb 16 '20 at 18:34
  • And I will make sure to check out all the links you sent, and respond if I have any more questions. Thank you! – RobyMann Feb 16 '20 at 18:37

0 Answers0