programming on target micro with other micro

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

I want to build a programmer that receive hex decimal code from serial port by a micro and save it on it's EEPROM , then program this code on target micro (another micro)

what should we do?

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Buy one from AlanK2 on this  forum. His are fantastic.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you dear ke7ehk,

It is a project that want we learn program a code on micro

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First you need to find an AVR with enough EEPROM to hold your program.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oh yeah,

is it possible to read/write on external eeprom?

 

Last Edited: Wed. May 15, 2019 - 05:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
First you need to find an AVR with enough EEPROM to hold your program.

Or you can locate your application in bootloader section and use FLASH instead of EEPROM to store data. Or even better use FLASH and EEPROM to increase space for data.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yes I will use eeprom (AT24C)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This should be similar to what you want:
http://www.fourwalledcubicle.com/ButtLoad.php

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I would suppose what you need is Stand-Alone In-Circuit-Programmer (You download your hex file from PC, flash it to the ICP and then you can forget completly about the PC and use only the ICP).

 

Depending on your programming target there is several providers, check this application note for a list of providers:

 

http://ww1.microchip.com/downloa...

 

Regards,

Moe

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry,I study this link but I don't understand any thing

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hasanzadeh99 wrote:

sorry,I study this link but I don't understand any thing

  •  

That is unfortunate because that project does almost exactly what you intend to do (though it uses AT45 dataflash rather than AT24C to hold the code). You are going to need to be able to understand pretty much everything that project does as you will end up doing almost exactly the same. One of the key files in that project is:

 

https://github.com/abcminiuser/buttload/blob/master/ISPChipComm.c

also

https://github.com/abcminiuser/buttload/blob/master/ISPChipComm.c

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear clawson ,

In this project we want to read data (hex files) from serial port,

then save it on the eeprom by micro1

then program this data on the micro2=micro target

 

 

thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, I understand that and the project that Kartman linked to in #8 is something that does exactly that (except that it receives the program code in .bin not .hex format as the hex-bin conversion is (sensibly) left to be done on the PC.

 

"Buttload" uses the Atmel Butterfly to implement almost exactly what you plan. But, like I say the "EEPROM" it uses is AT45 Dataflash (that happens to be part of the Butterfly design already) rather than the AT24C you propose to use. But the stuff involved in receiving the code image, storing it, then later passing it onto the other AVR are all very similar to the elements you require.

 

Dean Camera who made the Buttload program later went on to create a USB support stack for the AVRs that have USB. As one of the example projects he created a clone of Atmel's own AVRISPmkII and that, once again, implements the ISP protocol which is what you need to implement to make one AVR able to program another one.

 

Another example worth looking at will also be Thomas Fischl's "USBAsp" code. Again it uses one AVR to perform ISP on another one.

 

All of these projects have been implemented by reading the chapter found in almost every AVR datasheet that explains how ISP works (generally it is a series of 4 byte command packets sent to the AVR over SPI). If you read that then you too can make an implementation of ISP too. But I'm saying it will help a lot to study projects where others have done the same. It's all very well reading about the raw command set used for ISP but understanding the order in which you then use those is best shown by example.

 

If you cannot read/follow the examples then perhaps your programming skills are not quite ready for undertaking a project of this complexity?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Yes, I understand that and the project that Kartman linked to in #8 is something that does exactly that (except that it receives the program code in .bin not .hex format as the hex-bin conversion is (sensibly) left to be done on the PC.

 

"Buttload" uses the Atmel Butterfly to implement almost exactly what you plan. But, like I say the "EEPROM" it uses is AT45 Dataflash (that happens to be part of the Butterfly design already) rather than the AT24C you propose to use. But the stuff involved in receiving the code image, storing it, then later passing it onto the other AVR are all very similar to the elements you require.

 

Dean Camera who made the Buttload program later went on to create a USB support stack for the AVRs that have USB. As one of the example projects he created a clone of Atmel's own AVRISPmkII and that, once again, implements the ISP protocol which is what you need to implement to make one AVR able to program another one.

 

Another example worth looking at will also be Thomas Fischl's "USBAsp" code. Again it uses one AVR to perform ISP on another one.

 

All of these projects have been implemented by reading the chapter found in almost every AVR datasheet that explains how ISP works (generally it is a series of 4 byte command packets sent to the AVR over SPI). If you read that then you too can make an implementation of ISP too. But I'm saying it will help a lot to study projects where others have done the same. It's all very well reading about the raw command set used for ISP but understanding the order in which you then use those is best shown by example.

 

If you cannot read/follow the examples then perhaps your programming skills are not quite ready for undertaking a project of this complexity?

 

 

thank from your complete answer

is there any document that explain about function or codes that implement in this github code?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The OP is starting several threads on programming AVR's every way but with an actual programmer.

 

https://www.avrfreaks.net/forum/...

 

https://www.avrfreaks.net/forum/...

 

Helpers beware.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jgmdesign wrote:

The OP is starting several threads on programming AVR's every way but with an actual programmer.

 

https://www.avrfreaks.net/forum/...

 

https://www.avrfreaks.net/forum/...

 

Helpers beware.

 

JIm

 

And add this thread to your list, Jim:

 

https://www.eca.ir/forums/thread84179.html

 

Jim, I think this user enjoys of painful approachs. Masochism!

e.g. s/he can understand many things about the programmer on the link that Kartman suggested. For example see P. 4 of the manual. There is the answer to this thread.

 

http://www.fourwalledcubicle.com/files/BL_Manual.pdf

 

Also, a lot of points are commented in the code. If it's a project to learn somthing, thus reading the code of BUTTLOAD could be really useful and helpful. A decent and well-written code. I don't know why the OP do not read everything in the link. The sushi is ready and just need to use chopsticks to pick up the sushi and eat it.

"One's value is inherent; money is not inherent"

 

Chuck, you are in my heart!