103Views13Replies

Author Options:

.HEX file to USB port? Answered

Lets say I have a .HEX file that looks something like this;

:100000000EC01DC01CC01BC01AC019C018C017C02C
:1000100016C015C014C013C012C011C010C01124E6
:100020001FBECFE5D2E0DEBFCDBF10E0A0E6B0E05E
:1000300001C01D92A136B107E1F702D0C6C0E0CFE2
:1000400080E090E0ACD081708093600004B600FE48
:100050000AC081E084BF60916000682760936000FF
:1000600080E090E0A4D0B89AB99ABA9ABB9ABC9AA8
:1000700061E042E034E028E090E18091600081306E
:1000800009F046C058B3592758BB59E979E9E1E06E
:1000900051507040E040E1F7000058B3592758BB79
:1000A00058B3522758BB59E979E9E1E05150704003
:1000B000E040E1F7000058B3522758BB58B353272C
:1000C00058BB59E979E9E1E051507040E040E1F76F
:1000D000000058B3532758BB58B3542758BB59E9AD
:1000E00079E9E1E051507040E040E1F7000058B399
:1000F000542758BB58B3582758BB59E979E9E1E070
:1001000051507040E040E1F7000058B3852745C0EA
:1001100088B3862788BB59E979E981E0515070405E
:100120008040E1F7000088B3862788BB88B3842726
:1001300088BBE9E959E971E0E15050407040E1F7CE
:10014000000088B3842788BB88B3832788BB89E9EC
:10015000E9E951E08150E0405040E1F7000088B308
:10016000832788BB88B3822788BB79E989E9E1E0E6
:1001700071508040E040E1F7000088B3822788BBDF
:1001800088B3892788BB59E979E981E051507040EB
:100190008040E1F7000088B3892788BB6ECFE199E2
:1001A000FECF9FBB8EBBE09A99278DB30895262F73
:1001B000E199FECF1CBA9FBB8EBB2DBB0FB6F89446
:0E01C000E29AE19A0FBE01960895F894FFCFDF
:00000001FF

And I need to send that to a USB port.  What is the best way to do this?  I have an little app that will let me send data to my USB port of choosing, but I have to type this thing out by hand, 2 characters at a time, hit enter, rinse and repeat, and then after its all entered, click send data.  That worked fine for sending a few bytes to test some hardware to verify data sent back form the device was correct and that it was receiving the data correctly, but that won't work here, for obvious reasons.  Is there some sort of free software I can download to shove .HEX files through a USB port?  I am sure there are, but I can't find any, Google is not being kind to me today.

Discussions

0
None
verence

2 years ago

What should your USB port do with that? It will stick in there, clogging it up.

Saying 'send it to the USB port' as the same as saying 'send it to the WLAN'. It has no meaning. USB and WLAN are transport channels. What is your endpoint on the other side?

0
None
steveastroukverence

Answer 2 years ago

<waves hands over crystal ball>

Serial port ?

0
None
verencesteveastrouk

Answer 2 years ago

Yes, most probably.

That would reduce the problem to: baudrate, number of data bits, parity, number of stop bits, flow control (XON/XOFF, CTS/RTS, DTR/DSR) and higher protocoll.....

On the other hand, it would be nice to know how Wesley did send his two characters by hand. Hell, we don't even know the operating system nor the platform. Are we talking Windows (XP/7/8/10), some Apple OS, Linux on PC or even a Rasberry PI - hey, he could be programming some mobile phone.

Unfortunately, my crystal ball came with one of those flat rates that switches back to dumb guessing after too many queries per month...

0
None
Electric Spectre1verence

Answer 2 years ago

Windows 10, end point is ATTiny85, USB-SPI bridge (MCP2210) before it. I learn by doing, or in most cases just trying, and this is what I am trying to do;

I can send data to the bridge with an SPI Terminal and if its plugged into a PS2 controller like I used for my Roomba and it sends back the correct values. If I send 80, 42, 00, I get FF, 82, 5A back. And if you send it another couple bytes, you receive the 2 bytes of button data back. That seems to be working fine. But I want to try plugging an ATTiny85 or other ATTiny/ATMega into it and try programming it. But I can't figure out how to send data in a more efficient way then typing it into the SPI Terminal and sending it.

Frankly I am not entirely sure if what I am trying to do is possible, but you learn more from failure then success or something like that, and I have already learnt a fair bit with this USB to SPI bridge.

0
None
verenceElectric Spectre1

Answer 2 years ago

So the question is now: Who to program my ATTiny85 with an USB-SPI bridge! (Under Windows10)

Well, to program a µC you have to send more data than just the program. You have to force the µC into a mode to be programmed. For this, your USB-SPI bridge has to handle the reset pin on the ISP header as well. if it doesn't, you are out of luck.

And then there is a whole protocol to be handled between programmer and µC. There are ready made ISP (in system-programming) programs for that. Check the website of the supplier of your bridge for such a program.

You may have to buy a special AVR ISP programmer. Make sure that they work under Windows 10, not all do.

0
None
Electric Spectre1verence

Answer 2 years ago

It can handle the Reset pin.

What would the ISP program be, something like AVRdude?

0
None
rickharrisElectric Spectre1

Answer 2 years ago

Ok It works a LOT better when you tell the whole story and ask the right questions.

Although I haven't tried this, there is a wealth of information all over the web re programming AT Tiny microprocessors - IN general they seem to take the approach that you use a Arduino to do the donkey work so you could purchase one to put between you SPI interface and the AT Tiny.

http://highlowtech.org/?p=1695

gives better details.

the problems with programming small bare micros is handling the data interface and making sure the data goes to the right place, This is where the Arduino and it's program comes in.

0
None
Electric Spectre1rickharris

Answer 2 years ago

Problem with that is I don't want to use Arduino. Arduino's are great and all for prototyping, but if I need something that may have code modified with some frequency I don't want to having to plug an Arduino in as well. Or using something bigger then an ATTiny85 at some point, or not Atmel or AVR based at all. I want to have a way to plug a USB/USB Micro cable into some of these boards that I want to purpose build for projects, whether it be for space, shape, etc.

0
None
Electric Spectre1rickharris

Answer 2 years ago

Whoops, yes. Reply directly to the thread, not to another comment, it won't let me pick a reply to a comment as a best answer.