Logic analyzer: What protocol is this? (images) - Page 1
Forum section: electronics / beginners

author: DOCa Cola
author_rank: Contributor
timestamp: September 30, 2015, 07:15:54 pm
content: I am currently working on a small project where i want to drive a joystick handle from an old joystick with a Teensy. Since the handle features a lot of buttons and controllable LEDs, it has it's own controller. I assumed this controller would exchange data with the main controller using SPI or something similar.I bought a cheap Saleae logic analyzer china knockoff for this project and this is also the first time i am using a logic analyzer. So i have no idea what i am looking at right now.I hooked up pins labeled D, D0, D1, CLK to the analyzer which i assumed would turn out to be a simple SPI communication happening. But it seems to be something else(?).I have attached two images.One shows a button press on the handle, which it sends back to the main microcontroller.The other shows where i disable an LED on the handle, which should be data sent from the main microntroller to the controller in the handle.Note that the time scale for the captured data is different on these two images. I wanted to show the whole action happening.Does anyone know what type of communication is being done here?

author: German_EE
author_rank: Super Contributor
timestamp: September 30, 2015, 08:53:32 pm
content: 1) This isn't I2C because the waveforms in I2C are active low due to pullup resistors at the end of the line.2) This isn't SPI because an SPI bus uses a clock signal in bunches of 8, 16 or 32 pulses to clock in each bit, high or low, and we are not seeing this on the waveforms you posted.There is a possibility that the data sent depends on the position/timing of the pulses on D or D1 after the clock line has gone high but this would be unusual.

author: DOCa Cola
author_rank: Contributor
timestamp: September 30, 2015, 09:44:26 pm
content: So it could be something custom then. I don't see a relation between the data lines or how it could work. I am unsure how to approach this.I have attached a full data sample of 2 button presses of a fire button followed by two button presses of another button on the stick. I assume the file can only be loaded with the Saleae utility. The software can still be used even without the hardware. It is available from herehttps://www.saleae.com/downloadsin case anyone wants to have a go at it.

author: Andy Watson
author_rank: Super Contributor
timestamp: September 30, 2015, 10:00:09 pm
content: Quote from: DOCa Cola on September 30, 2015, 09:44:26 pmLook at thechangescaused by operating the various buttons. Change one thing and only one thing for each test.Does the communication happen without any button presses? - This should give you a base line with which to compare the state when buttons are pressed.What does the communicationneedto transfer? Buttons will (probably) be transferred as single bits, but are there any analogue signals?

author: bitwelder
author_rank: Super Contributor
timestamp: October 01, 2015, 04:52:21 am
content: Sorry for proposing perhaps the obvious, but have you looked at the joystick controller IC and searched for its datasheet?

author: kripton2035
author_rank: Super Contributor
timestamp: October 01, 2015, 08:26:37 am
content: isn't it simply a debouncing problem ?if you press the same button again and again does it output the same signals or not ?

author: DOCa Cola
author_rank: Contributor
timestamp: October 01, 2015, 09:01:14 am
content: Thanks for your input so far!Here is what i found out so far and some general background information:The Joystick is a Saitek X52. If i didn't miss something it has three controllers. The main controller is a cypress cy8c24794. But it is not the one i am directly sniffing the data lines from.The cypress is in the throttle control and seems to control usb communication and an LCD display. In a separate case connected through a 6 pin cable - which i assume uses a similar protocol as the one i am analyzing - is the actual joystick.In the joystick case are the two remaining controllers, which i am currently trying to analyze their communication. One is in the base of the joystick. It controls some buttons/LEDs there. The other is in the handle.The controller in the handle seems to only control the buttons and on/off states of the various LEDs there. The controller in the base also does analogue type stuff, as it has a separate line from the handle just for the z-axis. Also it does all PWM control for brightness of the LEDs through a separate line. The data lines i am analyzing should therefore only contain simple on/off statesBoth of these are epoxy blopped. So i don't know what kind of chips these are.In the handle there are 18 Buttons (Trigger 1+2, Pinky, 4 way switch, second 4 way switch, mode switch (3 states), and 4 more regular buttons).There are 4 controllable LEDs in the handle. 3 of those are dual LEDs (green/red) which can be either be off, both lit (gives amber color), or only one of the colors (green or red). The remaining one is just an on/off LED.Communication tests (images):There is only communication when i actually trigger a button or when i configure the LEDs on the Handle via Windows software.I have recorded the communication of two buttons when i press these down and on release.For the push down state, i did this two times for each button as comparison.There seems to be a pattern in the D1 line. This might be the active bits. When i push down a button, there seem to be two blips. When i release a button, there is only one blip on D1.Either D0 or D is the clock then (maybe?)Note: The time scale on these images slightly differ. There seems to be no way in the Saleae software to define a fixed time scale. So i tried my best to scale them accordingly.What do you guys think?Edit:Could the D0 line be some kind of wake/clock signal for the chip in the handle sent by the master chip in the base? If you look at the image my initial post for the Button communication, D0 is high for a quite long time. So could it be that the master chip in the base of the joystick is giving the handle-chip a clock signal which it then returns with data?Edit2:In the case of button traffic it has to be the other way round, since the handle-chip requests a clock signal from the master chip in the base.

author: amyk
author_rank: Super Contributor
timestamp: October 01, 2015, 11:35:28 am
content: That's a USB joystick... could it be low-speed USB on two of the pairs?There could be auxillary data on the other two, but the fact that two of the signals look (almost) differential suggests either USB or some form of async serial to me.