Author Topic: Testing device to talk I2C/SPI/bitbanging  (Read 1779 times)

0 Members and 1 Guest are viewing this topic.

Offline kuonTopic starter

  • Regular Contributor
  • *
  • Posts: 162
  • Country: ch
Testing device to talk I2C/SPI/bitbanging
« on: January 05, 2024, 09:44:54 pm »
I am looking for an USB device I can program from linux (C at minimum and if possible higher level language) that I can use to test I2C, SPI and bitbanging.

I'm aware of bus pirate but I wonder if there is something newer with those features:

- I2C clock stretching support
- Minimal logic analyzer (monitoring some pins and dumping a CSV file is enough, but I'm not against fancy features)
- CAN support would be nice, but not not a requirement
- 3.3V required, but if there is something that can do both 3.3 and 5V I would be happy
- USB galvanic isolation would be nice, I have an USB isolator, but if it's embedded it's one less thing I can forget
- Visualization on the board would be a nice plus, like a LED per output that is lit for high and off for low, or a small display. The minimum would be a LED just to be sure the program I sent from the PC is running, this would gain time as I wouldn't have to hook the scope each time.
 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 723
  • Country: us
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #1 on: January 06, 2024, 01:41:55 am »
Look at FT2232H, if you are looking to write code on your host, not on a microcontroller. You’ll find good open source support and plenty of drivers from FTDI.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2857
  • Country: us
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #2 on: January 06, 2024, 02:41:47 am »
I spun my own version of DLP's DLP-245PL-G USB-Microcontroller Development Board.

The I/O is controlled by tokens sent from the USB bus.  The FT245RL FTDI chip's I/O can be either 3.3V or 5V if used in conjunction with a PIC18(LF) microcontroller.  The VCCIO pin of the FT245RL sets the voltage for the I/O pins.  When you purchase one of their modules, they give you a link to the firmware.  Which, I re-wrote and added my own commands.  Their original firmware only does digital I/O and ADC conversion.

You will need a PICKIT to re-program the firmware.
« Last Edit: January 06, 2024, 02:47:01 am by MarkF »
 
The following users thanked this post: kuon

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6409
  • Country: 00
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #3 on: January 06, 2024, 06:35:12 am »
These people have interesting boards. I used their I2CMini from a python script and it was very easy to use.  https://i2cdriver.com/

Bus pirate is a stale product. Got one, tried to access from Python and had hard time to find a supported library that works.
 
The following users thanked this post: kuon

Offline kuonTopic starter

  • Regular Contributor
  • *
  • Posts: 162
  • Country: ch
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #4 on: January 06, 2024, 02:01:56 pm »
Look at FT2232H, if you are looking to write code on your host, not on a microcontroller. You’ll find good open source support and plenty of drivers from FTDI.

I should have mentioned that I tried the FT2232H board. But the I2C does not support clock stretching. There is a software hack that does, but it's unreliable.
 

Offline kuonTopic starter

  • Regular Contributor
  • *
  • Posts: 162
  • Country: ch
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #5 on: January 06, 2024, 02:10:49 pm »
These people have interesting boards. I used their I2CMini from a python script and it was very easy to use.  https://i2cdriver.com/


They look really nice! But I would need the two of them and I cannot do bit banging which is something I need. Still, I will try them.

I spun my own version of DLP's DLP-245PL-G USB-Microcontroller Development Board.


This looks promising. After a quick read I do not really get how this is programmed, but I'm sure it cannot be that convoluted.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2857
  • Country: us
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #6 on: January 06, 2024, 02:25:06 pm »
I spun my own version of DLP's DLP-245PL-G USB-Microcontroller Development Board.


This looks promising. After a quick read I do not really get how this is programmed, but I'm sure it cannot be that convoluted.

If you look at the schematic at the end of their datasheet, there is a 5-pin programming header (J1) to the left of the PIC microcontroller.
 

Offline kuonTopic starter

  • Regular Contributor
  • *
  • Posts: 162
  • Country: ch
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #7 on: January 06, 2024, 02:27:53 pm »

This looks promising. After a quick read I do not really get how this is programmed, but I'm sure it cannot be that convoluted.

If you look at the schematic at the end of their datasheet, there is a 5-pin programming header (J1) to the left of the PIC microcontroller.

Ah yes, I missed that, you have direct access to the MCU.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2368
  • Country: au
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #8 on: January 06, 2024, 10:19:34 pm »
I should have mentioned that I tried the FT2232H board. But the I2C does not support clock stretching. There is a software hack that does, but it's unreliable.

Maybe try the FT4222H ? which claims
Clock stretching support in master and slave mode

I'd think the SPI can be leveraged to do 4 lanes of logic analyzer capture.

It's not clear if SPI and i2c can be simultaneously active, but using two modules may be simpler anyway.  There is some web mention of python libraries for FT4222H
 

Offline kuonTopic starter

  • Regular Contributor
  • *
  • Posts: 162
  • Country: ch
Re: Testing device to talk I2C/SPI/bitbanging
« Reply #9 on: January 07, 2024, 02:14:55 pm »
I will try the FT4222H, but I really like the look of the I2Cmini board, I wish something like that would exist with all protocols I need.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf