SCPI-like USB to I2C/SPI/1-Wire converter - Page 1
Forum section: electronics / projects

author: VforVolts
author_rank: Newbie
timestamp: March 12, 2017, 12:03:56 pm
content: Hi everyone.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 operationI2C masterSPI master1-Wire master4x GPIOs2x 10 bit PWM outputs3x 10 bit ADC inputs1x 5 bit DAC outputNB: 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.

author: JPortici
author_rank: Super Contributor
timestamp: March 12, 2017, 12:38:44 pm
content: Did you know that microchip (and possibly others) already have something like this in their catalog?Like:http://www.microchip.com/wwwproducts/en/MCP2210This should actually be a pic16 with usb, mask rom with a usb-to-spi/i2c/uart/whatever firmware

author: JPortici
author_rank: Super Contributor
timestamp: March 12, 2017, 12:40:41 pm
content: But don't let this crush your expectationsimho your selling point is (or should be) the high level language programming

author: VforVolts
author_rank: Newbie
timestamp: March 12, 2017, 01:09:04 pm
content: Quote from: JPortici on March 12, 2017, 12:38:44 pmYes, 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) 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.Quote from: JPortici on March 12, 2017, 12:40:41 pmYup. 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.

author: ajb
author_rank: Super Contributor
timestamp: March 13, 2017, 12:52:59 pm
content: 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

author: tszaboo
author_rank: Super Contributor
timestamp: March 13, 2017, 03:04:51 pm
content: I dont want to the bad guy, but any arduino can be programmed to support this functionality, and they cost something like 3 dollar.

author: BrianHG
author_rank: Super Contributor
timestamp: March 13, 2017, 04:08:22 pm
content: You can look at FTDI's lineup:http://www.ftdichip.com/FT-X.htm

author: VforVolts
author_rank: Newbie
timestamp: March 13, 2017, 04:57:29 pm
content: Quote from: NANDBlog on March 13, 2017, 03:04:51 pmThis 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.

author: VforVolts
author_rank: Newbie
timestamp: March 13, 2017, 05:10:19 pm
content: Quote from: BrianHG on March 13, 2017, 04:08:22 pmYes, 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.

author: Zbig
author_rank: Frequent Contributor
timestamp: March 13, 2017, 05:32:03 pm
content: 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...

author: VforVolts
author_rank: Newbie
timestamp: March 13, 2017, 06:25:59 pm
content: Quote from: Zbig on March 13, 2017, 05:32:03 pmI 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 #313I'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.

author: bson
author_rank: Unknown
timestamp: March 14, 2017, 05:47:32 pm
content: 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...