Photon 320 RS232/Serial issue - wrong data, commands not working? - Page 1
Forum section: electronics / general

author: Spirit532
author_rank: Frequent Contributor
timestamp: February 27, 2018, 01:09:44 pm
content: So I have a FLIR Photon 320 connected to a MAX232 and then to a CP1202 USB->Serial converter.This combination seems to operate fine, but I am getting weird results when I try sending and receiving data.The datasheet(here:https://i.spirit.re/PIKwZ.pdf) says that if I sendCode:0x6E 0x00 0x00 0x02 0x00 0x00 0xB1 0xDB 0x00 0x00to the Photon, it will reboot and send me the same bytes in response.However, what I am getting instead isCode:0x6E 0xF8 0xF3 0xC3 0xF1 0xF9 0x6C 0x3B 0xF3The Photon, obviously, does not reboot.The port is set to the specified 57600 baud, 8 bits of data, no parity, 1 stop bit, and no flow control.I am using Realterm to do this.This is the transmit(to camera) waveform:This is the receive(from camera) waveform:

author: railrun
author_rank: Regular Contributor
timestamp: February 27, 2018, 01:45:48 pm
content: Have you already tried to use the Photon-GUI to test your setup?

author: Fraser
author_rank: Super Contributor
timestamp: February 27, 2018, 02:38:14 pm
content: Hiya,Have you seen my TAU teardown thread where I built an interface for the TAU. As you may know, the TAU is the direct descendant from thecPhoton core. I have not read thecPhoton ICD but the Tau uses inverse polarity UART signalling at 3V3. It does not like 5V sinnalling.https://www.eevblog.com/forum/thermal-imaging/thermal-camera-teardown-the-flir-tau-320-by-fraser/msg1002518/#msg1002518Fraser

author: Fraser
author_rank: Super Contributor
timestamp: February 27, 2018, 02:43:20 pm
content: Here is the full text from my post on the TAU interface in that other thread....For anyone wanting to connect to a TAU core without the FLIR VPC module, here is the information you need.The FLIR VPC provides the following facilities to the user:1. 5V power for camera from USB source or external 5V power supply. Current at boot is ~500mA dropping to a nominal 180mA2. USB to Pseudo 'RS232' conversion, providing the required 3V3 levels for the core.3. Analogue Composite video output NTSC or PAL depending upon core settings.So what 'lives' inside the VPC ?In truth I do not know as I have not seen one up close. I do know that it contains a CP2102 USB to UART converter that provides a 3V3 TTL output. The VPC may contain some power input protection, I would hope so for what it costs.To build your own VPC you will need the following parts1. Hirose DF12-50DP-0.5 header connector (costs less tha £1 from Farnell)2. Some form of PCB on to which to attach Hirose connector. Pin pitch is 0.5mm3. CP2102 converter PCB from ebay (costs less than £2.00)4. Video connector of your choice5. Micro USB cable6. Micro USB Power supplu 5V, 1A max (optional)The pins that must be connected to the core connector:Pin Function1 RS232 TX2 RS232 RX5 D Gnd for RS23243 Video out High44 Video out Low47 0V49 0V48 5V50 5VNote that the TAU core provides a Hi-Z analogue video output that is intended to be terminated with 150 Ohms or 75 Ohms depending upon user requirements.I would add a protection diode across the 5V supply rail and a series high speed fuse to offer some protection to revers polarity errors.All this costs a few pounds and is pretty easy to build. The official VPC costs around £150 in the UK and has to be ordered.The TAU GUI software for testing and configuration is free and available from the FLIR download page.http://www.flir.com/cores/display/?id=51880The software comes with the CP2102 driver software and installs it after the GUI installation is complete. Power can come from the USB port so no other power supply is needed. The CP2102 PCB that I bought from ebay includes a 5V output pin for just such use.I include pictures of the FLIR VPC, CP2102 PCB, Hirose DF12 connector information and an extract from the TAU manual detailing the interface and pin layout.UPDATE: Note that the TAU uses inverse UART polarisation. That is to say, Logic 0 = +3V3 and Logic 1 = 0V. You need to place a 74HC04 inveter IC in line with the RX and TX lines if using a standard USB to CP2102 adapter. Take the 3V3 supply for the inverter from the CP2102 PC.

author: Fraser
author_rank: Super Contributor
timestamp: March 01, 2018, 12:24:40 pm
content: Any joy on the Photon communications ?Fraser

author: Spirit532
author_rank: Frequent Contributor
timestamp: March 01, 2018, 05:14:43 pm
content: None so far.The MAX232 transceiver inside seems to behave oddly.I don't have any inverters on hand though(for some odd reason), I tested it by just using a makeshift inverter out of two NAND gates(74HC00D), which didn't work.I guess i'll just have to order some actual 74HC04 devices and see if that works.

author: Fraser
author_rank: Super Contributor
timestamp: March 01, 2018, 05:44:36 pm
content: I am a little confused why you used a MAX232. The correct signal path is as follows....PC USB to CP2102 USB/Serial UART bridge. The output of the CP2102 is TTL logic levels for 5V UART use. This is fed into the CMOS inverter IC as the Photon requires standard RS232 polarity but at 3V3 UART levels. To achieve the required 3V3 amplitude at the output of the inverter the supply to that chip is fed 3v3 from my CP2102 board. This acts as an effective inverter and level translator.As you know the MAX232 converts 0V and 5V to and from -12V and +12V. I am unsure how you used it but hope you did not feed the + 12V and - 12V into the Photon..... that would be very bad news.Fraser

author: Spirit532
author_rank: Frequent Contributor
timestamp: March 01, 2018, 05:53:12 pm
content: I didn't use a MAX232.The MAX232 is inside the camera - it can withstand +-12V anyway.The CP2102 outputs 3.3V signals.

author: Fraser
author_rank: Super Contributor
timestamp: March 01, 2018, 08:11:20 pm
content: Ah, sorry, I had not realised your Photon had a MAX232 fitted. My mistake.In that case, normal RS232 communications polarity and levels would apply.I am used to connecting directly to the 3V3 communications port.Fraser