Author Topic: SCPI-like USB to I2C/SPI/1-Wire converter  (Read 3313 times)

0 Members and 1 Guest are viewing this topic.

Offline VforVoltsTopic starter

  • Newbie
  • Posts: 5
  • Country: it
SCPI-like USB to I2C/SPI/1-Wire converter
« on: March 12, 2017, 12:03:56 pm »
Hi everyone.  :D
I'd like to get some feedback regarding a little project I've been working on for a while.

Long story short, it's a USB to I2C/SPI/1-Wire converter. It started as a project I was doing for myself but I'd like to know if there are other people interested in it.

I know there are already other alternatives, like the Bus Pirate or even a SBC, but this is a little bit different.

The main philosophy behind this project is to keep the PC side software as simple as possible.
The board communicate with the computer through a USB to UART converter.
The commands sent and received by the board are human-readable SCPI-like strings (eg. ":I2C:WRITE 12 34 AB CD").
This should make it possible to quickly write little programs using any high-level programming language capable of talking to a serial port like python, ruby, perl, etc.
A few use cases might be reading a sensor for data logging or reading/writing an I2C EEPROM or any other scenario where using a microcontroller and writing a proper firmware might not be worth the time and effort.

The board at the moment has:
  • 5V and 3.3V operation
  • I2C master
  • SPI master
  • 1-Wire master
  • 4x GPIOs
  • 2x 10 bit PWM outputs
  • 3x 10 bit ADC inputs
  • 1x 5 bit DAC output
NB: Not all functions can be used at the same time (many use the same MCU pins)

The pcb is already done and I'm currently finishing writing the firmware.
I'm an EE student and I don't have much free time right now, so it probably won't be finished before this summer.

Everything (PCB, bootloader and firmware) will be open source.

I'd like to sell it (probably on Tindie) but I'm not yet sure about the price.
The sweet spot seems to be around 15USD which makes it both affordable for everyone and profitable for me.
I'll probably sell a kit (pcb, components and pre-programmed MCU) for about 13USD and an assembled and tested board for about 18USD.
Shipping worldwide will be 5USD untracked and 10USD tracked.

Does it sound useful? Is it something you would buy?

Any suggestions will be very appreciated.  :)
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3525
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #1 on: March 12, 2017, 12:38:44 pm »
Did you know that microchip (and possibly others) already have something like this in their catalog?
Like: http://www.microchip.com/wwwproducts/en/MCP2210
This should actually be a pic16 with usb, mask rom with a usb-to-spi/i2c/uart/whatever firmware
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3525
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #2 on: March 12, 2017, 12:40:41 pm »
But don't let this crush your expectations :) imho your selling point is (or should be) the high level language programming
 

Offline VforVoltsTopic starter

  • Newbie
  • Posts: 5
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #3 on: March 12, 2017, 01:09:04 pm »
Did you know that microchip (and possibly others) already have something like this in their catalog?
Like: http://www.microchip.com/wwwproducts/en/MCP2210
This should actually be a pic16 with usb, mask rom with a usb-to-spi/i2c/uart/whatever firmware
Yes, I know. But most of them use an HID interface, often more difficult to use than a simple serial port.
Also my "thing" (I really need a name for it ;D) is text based so for a quick check ("does this sensor still work?") you can just open a serial terminal like putty, realterm, termite, etc. and directly write a command without having to write a program.

But don't let this crush your expectations :) imho your selling point is (or should be) the high level language programming
Yup. C is cool and all but I'd rather write 20 lines of Python than 100 line of C, unless I really need to... Life is too short.  :scared:
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: us
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #4 on: March 13, 2017, 12:52:59 pm »
I like the idea, and have been thinking about something quite like it.  I was thinking of using an Atmel SAM D part, since their SERCOM peripherals allow the same set of four pins to be configured for UART, SPI, I2C, etc.  There are parts available with six or more SERCOMs plus USB, but that may be a bit excessive  :).

One nice feature would be a built-in power supply.  I was thinking that a built-in DAC could be used to adjust a regulator, but that may be tough to get into your target price point.  Even just bringing out the USB 5V plus a 3.3V regulated supply would be handy.

I look forward to seeing your project  :-+
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 7938
  • Country: nl
  • Current job: ATEX product design
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #5 on: March 13, 2017, 03:04:51 pm »
I dont want to the bad guy, but any arduino can be programmed to support this functionality, and they cost something like 3 dollar.
 

Online BrianHG

  • Super Contributor
  • ***
  • Posts: 8111
  • Country: ca
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #6 on: March 13, 2017, 04:08:22 pm »
You can look at FTDI's lineup:
http://www.ftdichip.com/FT-X.htm

 

Offline VforVoltsTopic starter

  • Newbie
  • Posts: 5
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #7 on: March 13, 2017, 04:57:29 pm »
I dont want to the bad guy, but any arduino can be programmed to support this functionality, and they cost something like 3 dollar.

This is a good point.
It's true, there are other alternatives for less money.

If you just need to send data to the computer (eg. log a temperature) you can indeed just get a 3$ arduino, download a library for the sensor, write 20 lines of code and you're done. In this case the arduino clearly wins.

Let's consider a different scenario.

Let's say you bought  a sensor on a breakout board on ebay for a few bucks and you want to try it to see how it works.
You have the datasheet open in front of you and you want to send a command to the chip and see what it sends back.
You can write some arduino code, compile it, program the arduino, see the output, change the code, recompile it, reprogram it, run the code again, etc.
Or you can open open an interactive console (for example, python) and just send, receive and process data on the fly without having to deal with the whole mcu workflow (compile, upload, debug, etc.).

Which of those two approaches one might prefer is of course a personal matter. There isn't a right or wrong here.
 

Offline VforVoltsTopic starter

  • Newbie
  • Posts: 5
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #8 on: March 13, 2017, 05:10:19 pm »
You can look at FTDI's lineup:
http://www.ftdichip.com/FT-X.htm
Yes, I know those too.

This is why I asked you guys for advice. I don't want to invest time and money in a useless product that nobody wants.  :-\
 

Offline Zbig

  • Frequent Contributor
  • **
  • Posts: 927
  • Country: pl
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #9 on: March 13, 2017, 05:32:03 pm »
Have you actually investigated Bus Pirate? You say you know it exists and then proceed to describe the functionality of your device and it still sounds like a Bus Pirate...
 

Offline VforVoltsTopic starter

  • Newbie
  • Posts: 5
  • Country: it
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #10 on: March 13, 2017, 06:25:59 pm »
Have you actually investigated Bus Pirate? You say you know it exists and then proceed to describe the functionality of your device and it still sounds like a Bus Pirate...
I never used it myself.
IIRC Dave used it in a video a few years ago so I vaguely remember how it works, but that's all I know.
EDIT: It was EEVblog #313

I'm not trying to compete with the Bus Pirate.
You can see my device as a less versatile cheap alternative to a Bus Pirate, if you want.  >:D
« Last Edit: March 13, 2017, 06:31:00 pm by VforVolts »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2457
  • Country: us
Re: SCPI-like USB to I2C/SPI/1-Wire converter
« Reply #11 on: March 14, 2017, 05:47:32 pm »
I'd be much more interested if it could operate as a bus device.  Say it can have 8 8 bit registers, 8 16 bit registers, one bytestream register.  Then on the PC these show up in a window as numeric values, except the bytestream register which shows up as a console text log.  Let me select how to display them: decimal, hex, binary, as bit fields, as numeric values, dials, bars, percentage, etc.  Maybe provide some readable registers, too, where I can enter values on the PC and read them off the device on the I2C bus.  Actually, this has been on my todo list for a long time...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf