RetroBSD

2.11BSD operating system for microcontrollers
It is currently Thu Dec 14, 2017 5:10 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 14, 2017 9:14 am 

Joined: Tue Nov 14, 2017 8:49 am
Posts: 1
I want to say here's the fundamental problem : I'm looking at a dev board for, say, a TI/AD/Microchip microprocessor or DSP. This is long before a full product design; we're talking proof-of-concept work here. I want to send data from a PC to be processed by my firmware, or have my firmware send data to my PC. And I want the rate to be of the order of 1-10MB/s.

15+ years ago, 1-10MB/s would have been quite niche. kB/s would have been more usual, and the dev board would have had a DB9 connector on it. I could have just plugged a serial cable between the dev board and my PC, perhaps with a USB-to-serial converter, and read and write to COMX or /dev/ttySX.

However, this scheme has a number of limitations that are now starting to show up:

I want MB/s, not kB/s.
The absolute max UART rate a 100MHz device could manage is still only 0.7 MB/s. SPI on the other hand allows up to 3-4 MB/s.
It's incredibly rare for PCs to come with serial ports now, so specialised adaptors are needed to interface with a PC eg. USB to serial cable.
But I'm stumped for what I could use to replace the old serial scheme. The main context for this question is sending serialised debugging data between vendor dev boards and a PC before design is finalised, so anything requiring secondary devices eg. Bluetooth isn't super useful. The µPs I typically work with are in the realm of TI's MSP430, Microchip's PIC32M*, and low power DSPs like the TI C55x or C674. Their dev boards might typically come with headers connected to SPI/I2C/UART peripherals.

Ethernet would require full implementation of a networking stack, which isn't really practical on the constrained DSPs or µPs I often work with. Furthermore most PCs only have one ethernet port, if at all, so you wouldn't be able to use it for wired networking.

Ground-up USB requires getting a vendor ID from a 3rd party, and reinventing all sorts of wheels at the driver and software level just to get data from one device to another.

Ideally I'd like to just be able to dump bytes in a peripheral register on my µP and drain it using Python on the PC or vice versa, using a cable most IT departments would have lying around, and get 1-10 MB/s. A bonus would be not having to poll every available port of whatever kind to find the device on a PC. Is this possible?
All guys has any suggestions that welcome.
Thanks all


Top
 Profile  
 
PostPosted: Tue Nov 14, 2017 10:19 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
A direct USB connection can get that kind of speeds. A High-Speed connection is 480Mbps overall or about 60MBps. Of course, that's shared by everything on the bus, and the kind of USB connection (Bulk, Interrupt, Isochronous, etc) defines the latency and smoothness of the transaction, but it's certainly possible to get high speeds like that.

I am working on a new USB stack for chipKIT which includes HS support for the MZ chips. It's not optimized yet for ultra high speed, but it works. It's all in my USB branch of the chipKIT-core:

  • https://github.com/majenkotech/chipKIT-Core/tree/usb

I can't remember the speeds I was getting in testing, but it's certainly a helluva lot faster than serial. And you have the choice of protocols - CDC/ACM, Raw HID, etc. (audio coming one day too, along with Mass Storage Device).

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Tue Nov 14, 2017 7:08 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2400
Location: Rapa Nui
Few days back I got a $7 FT232H board from ebay.
https://www.ebay.com/itm/CJMCU-FT232H-H ... SwsXFZHAiM
It is an FTDI chip, high speed 480Mbps at the PC side, fully supported by Win and Linux, at the MCU side it offers:
Quote:
Single channel USB to serial / parallel ports with a variety of configurations.
Entire USB protocol handled on the chip. No USB specific firmware programming required.
USB 2.0 Hi-Speed (480Mbits/Second) and Full Speed (12Mbits/Second) compatible.
Multi-Protocol Synchronous Serial Engine (MPSSE) to simplify synchronous serial protocol (USB to JTAG, I2C, SPI or bit-bang) design.
UART transfer data rate up to 12Mbaud. (RS232 Data Rate limited by external level shifter).
USB to asynchronous 245 FIFO mode for transfer data rate up to 8 MByte/Sec.
USB to synchronous 245 parallel FIFO mode for transfers up to 40 Mbytes/Sec

So the best scenario for you would be the FT232H connected to your MCU via SPI or JTAG...
The pic32mx/mz can do 20/50Mbit/sec via SPI (2.5/6MB/sec).

Adafruit sells the identical board ($15) and perhaps there is python support as well
https://learn.adafruit.com/adafruit-ft2 ... t/overview
Python for the FT232H:
https://learn.adafruit.com/adafruit-ft2 ... psse-setup
https://pypi.python.org/pypi/pyftdi
http://eblot.github.io/pyftdi/

With USB on the pic32mx/mz you may get ~0.5MByte/sec rd/wr FS reliably when lucky.

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Nov 15, 2017 12:58 am 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Gundan,

Doesn't seem that hard unless you want to use stuff in the 'normal' way. i.e.- gotta do http. instead of just send the data.

The big advantage of USB2 was the receive buffering so the processor could be doing something else while waiting for data to come in. Most so called high speed data consists of ping-pong buffers. But if you don't have to do that much processing with the received data you can just dedicate your micro to mostly receiving or sending data.

In a lot of cases your really have bursts of data at the high rate followed by display or analysis. In this case your problem is not that hard. Conventional Oscilloscopes for example display at a high rate but only in bursts.

Interesting question.

Wiz


Top
 Profile  
 
PostPosted: Wed Nov 15, 2017 10:10 am 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
The next stage of the new USB stack is to implement DMA so as to free up the CPU a little more while reception/transmission is going on. That's going to be fun...

Especially on the MZ chips that have their own dedicated USB DMA channels...

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission