Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 23
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
05/04 Matthew T. (35)
05/04 Amrit Deshmukh (60)
05/05 Alexandre (32)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Computer Science
« Previous topic | Next topic »   

Capture data from COM port

Move Thread LAN_403
GeordieBoy
Mon Mar 30 2015, 02:49PM Print
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
Hi all,

Can anyone recommend a good program that will enable me to capture raw data from a COM port and write it directly to a raw binary file on disk?

I'm using one of those FTDI chips to give me a 3Mbit/s serial interface for downloading 32 Megabytes of data from an embedded system that i'm currently developing. I've tried using the usual suspects like "Putty" and "HyperTerminal", and also the command line "copy com3: /b file.raw" with some success, but not without problems.

Putty and HyperTerminal try to display the raw data as ASCII characters in the window while the data is coming in, and keep de-asserting CTS (flow control) to temporarily suspend the transmission of data. As a result the download of data takes about 3 times longer than it should. I can't find any way of disabling the screen updates. After all, I have no need to see a window full of flickering hearts and diamonds ill

For some reasons the command line "copy com3: /b file.raw" stops directing the received stream to the file after it encounters the first ASCII "EOF" character, which inevitably happens in several places in my raw data transmission. This seems strange, as I thought that the "/b" switch was meant to tell the copy command that it's dealing with a raw binary file and stop this behaviour. (It works for transmission of a raw binary file using the command "copy file.raw /b com4:" but not for reception.)

So can anyone recommend a good utility for redirecting raw received COM data to a disk file on a Windows PC?

Many thanks in advance.

-Richie Burnett,
Back to top
Linas
Mon Mar 30 2015, 03:19PM
Linas Registered Member #1143 Joined: Sun Nov 25 2007, 04:55PM
Location: Vilnius, Lithuania
Posts: 721
do you must use UART, or you can use SPI (FT2232H/D)

With SPI and labview it is easy to get data at 12Mbps from MCU, but Labview acts as master, and mcu use dma to send data
Back to top
GeordieBoy
Mon Mar 30 2015, 03:39PM
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
I could use SPI.

My system actually consists of a dsPIC processor to perform the data-acquisition and some basic DSP processing, with a high-speed SPI connection to a Spansion 32MByte FLASH chip to store the results. I'm really just wanting to download the 32MB worth of data out of the FLASH chip to the PC so that I can check everything is functioning correctly in the acquisition software.

One option would be for me to remove the SPI flash chip from the system and read it in a Flash chip programmer. It's just a bit inconvenient. I went down the UART/FTDI/USB route to download the data because my dsPIC chip has a spare UART available and I had one of the ready-made TTL-232R-3V3 FTDI cables lying around. So I thought i'd make use of that option and leave it connected while debugging.

I have Labview available where i'm currently doing the work, but may encounter problems getting my employer to license it for use on other computers where I might want to download data too. That's why I was hoping for a more generic solution if possible. I suppose I can live with the Putty download speed, with it's flickering and bell sounds, but thought there might be a better utility. Putty also puts a "----- Captured by Putty -----" header at the start of the capture file too, which is mildly annoying because i have to strip that out.

FWIW, the final incarnation of what i'm working on will actually download it's results wirelessly. I'm quite prepared to wait a longer time for the download then, but it's a pain in the backside waiting 15 mins for download during the debugging stage just to know what i've written to the Flash chip.

-Richie,
Back to top
Linas
Mon Mar 30 2015, 03:49PM
Linas Registered Member #1143 Joined: Sun Nov 25 2007, 04:55PM
Location: Vilnius, Lithuania
Posts: 721
i have all programs that can be used with Labview or VisualStudio,

solution would be just send data to flash, go to High z state, and connect FT2232D/H and read data, i could do that with visual basic in no time :) ( write address, read 66565 chars, write address, read 65535 chars, do intull you have data you want)

This is how i implemented DSP programmer, DSP use 2MB flash for program, and FT2232D put dsp in reset, connect to SPI bus via buss drivers, reprogram flash, and release dsp from reset, you just have to do reversal of this action, easy
Back to top
GeordieBoy
Mon Mar 30 2015, 06:13PM
GeordieBoy Registered Member #1232 Joined: Wed Jan 16 2008, 10:53PM
Location: Doon tha Toon!
Posts: 881
It seems like I have a workable solution...

Linas, when you mentioned Visual Basic it made me think about trying to write a simple QBasic program to read from the COM port and write the bytes straight to a file. I've got QB64 on this PC but never thought it would be anywhere near fast enough to cope with comms at 3Mbits/s. Well, it was! smile

I managed to transfer a known 16MByte PRBS test pattern from the flash memory to the PC and write it to disk in almost exactly 60 seconds. I thought that the QBasic program was probably dropping the CTS line to throttle the data rate, but working out the timing suggests 2.8Mbits/s. That's plenty fast enough for this debugging application smile (I even tried the download with streamed video (BBC iPlayer) running in two IE windows at the same time and was amazed that it didn't drop a byte, and only slowed to about 2.5Mbits/s.)

QBasic has obviously progressed since the last time I played with it 30 years ago!

Linas, It's nice to know that I can go faster than 3Mbits/s too if I need to. The SPI option would be nice too. As you said I already have the SPI bus and could also possibly DMA some data straight from the DSP to the FT2232 chip that you mentioned to help with debugging. Lots of options.

For now I'm happy, that I have something that works, but it's nice to know some other options. The people at work will most likely like the Labview option because they have a history of using it.

Many thanks,

-Richie,
Back to top

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.