Author Topic: Detect Protocol on bus  (Read 1306 times)

0 Members and 1 Guest are viewing this topic.

Offline LittleRainTopic starter

  • Contributor
  • Posts: 47
  • Country: ca
Detect Protocol on bus
« on: October 05, 2019, 02:02:14 am »
Just got my first CPLD, the Altera Max II.
I was wondering if it would be possible to detect a protocol on a bus, not necessarily for the max II, just in general.

What I want to do, is add a micro USB port to my board, and use custom cables that plug into different devices with different protocols.

One device would be a regular PC, and use regular USB.
Then another device uses SPI, another using 1 wire, and possibly some other protocols, not at the same time of course.

What I want the CPLD to do, is to detect what protocol it is, and then forward the signal to the correct pins on a micro controller.
The device is hand held, and doesn't have the room to have separate ports for each protocol.

Is this possible, and how would I go about getting started on something like this?

Thanks
 

Offline rjp

  • Regular Contributor
  • *
  • Posts: 124
  • Country: au
Re: Detect Protocol on bus
« Reply #1 on: October 05, 2019, 02:05:49 am »
sounds like a digital logic analyzer ?

if you dont want to take on the hardware and the software, learning how to drive https://sigrok.org/  would probably be a start, you get lots of protocol decoders for free.
--

misread requirement, sorry.
« Last Edit: October 05, 2019, 02:24:10 am by rjp »
 

Offline LittleRainTopic starter

  • Contributor
  • Posts: 47
  • Country: ca
Re: Detect Protocol on bus
« Reply #2 on: October 05, 2019, 02:18:28 am »
Not quite, I already have a logic analyzer actually.
Sorry I should have been a little more specific, once it finds out which protocol, I need my device to start talking to the PC/device on said protocol.
I basically want to squish a few devices I have made, and am currently working on, into 1 device.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: Detect Protocol on bus
« Reply #3 on: October 13, 2019, 09:13:03 pm »
Use a pin, or a couple to give an ID to each cable, now it just knows the protocol based on the cable that is plugged in.

Or just use a couple positions/connectors, and each position is one protocol.
 

Offline LittleRainTopic starter

  • Contributor
  • Posts: 47
  • Country: ca
Re: Detect Protocol on bus
« Reply #4 on: October 16, 2019, 04:38:43 am »
I was thinking about doing that, but I'd have to use USB C to get enough pins for each ID, and unfortunately I'd have to do the same for the position based approach.
But if it is cost effective compared to a CPLD I may as well go that route. Big problem is, if the consumer uses a regular USB C cable, power could be sent to another buses pins.
I'll look into it further though, thanks.
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Detect Protocol on bus
« Reply #5 on: October 23, 2019, 08:50:48 am »
I was thinking about doing that, but I'd have to use USB C to get enough pins for each ID

What about a multi-way IDC header/connector?

Or perhaps a smaller connector, even USB type A, but hook various resistor values up to one pin and use an ADC or some opamps to detect various voltages created by a resistor divider, with each voltage corresponding to a different protocol?
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Detect Protocol on bus
« Reply #6 on: October 23, 2019, 07:07:39 pm »
I2C EEPROMs are available in SOT23-5 packages.
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf