Project with an ATSAM3X8E and ATMEGA16U2

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

Hello,

 

im trying to figure out if it is possible to read data with the ATMEGA16U2 from the ICSP interface. But lets start from the beginning to give all of u a better overview and may find some buggs in my thoughts.

I am working with a Taijiuino Due R3 with an ATSAM3X8E, a Taijiuino Due Prog (usb to serial) with an ATMEGA16U2 and a ethernet module. Here's a link for a better description: http://www.elechouse.com/elechouse/index.php?main_page=product_info&products_id=2230

Now  what I am going to try: I want to send a program through the ethernet to my ethernet module which one is on the ATSAM3X8E board. The ATSAM3X8E should send the programm to the ATMEGA16U2 which one loads the programm on a memory. The memory will sit on the ICSP interface. The ATMEGA16U2 and the ICSP interface are on the same board. After the whole program gets written into the the memory, the ATMEGA16U2 will download the program. The ATMEGA16U2 will programming the ATSAM3X8E with the programm.

I do not know how the memory on the ICSP interface will look like atm. It is more important to me to know if it's even possible to do it in that way? Have a nice day!

 

 

Kind regards

 

Dustin

 

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

This sound like a horrendously over-complicated scheme!

 

surprise

 

What is the purpose of the ATMEGA16U2?

 

Surely, all you need is a bootloader on the ATSAM3X8E and then it can do it all itself?

 

A diagram would help ...

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

it sounds pretty complicated for the first time, i know :D

 

The purpose of the ATMEGA16U2 is that he is connected to the ATSAM3X8E over the programming port (serial). I think thats the only way to programm the ATSAM3X8E? Isn't it?

 

         ethernet                                  SPI                            serial  (programming port)                            ICSP

[PC]------------->[Ethernet module]-------->[ATSAM3X8E]<------------------------------->[ATMEGA16U2]<-------->[FlashMemory]

 

At the end i want to choose a program with a pc and send it via ethernet to my ethernet module . To programing the ATSAM3X8E with the program from my ethernet module  i have to go a little detour. 

 

I don't know how u want to send a programm through the ethernet right into the bootloader from the ATSAM3X8E. Is that even possible?

 

 

Kind regards 

 

Dustin

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

Of course it's possible!

 

Ethernet is just a means of getting the data to the target; the bootloader doesn't need to know how the data arrived - it just needs to program it into the flash!

 

EDIT

 

The ROM Bootloader in the SAM3X/3A doesn't do Ethernet - so you would have to have a custom bootloader.

 

But that is commonplace ...

 

Last Edited: Fri. Oct 27, 2017 - 09:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah okay! That sounds pretty interesting.

 

My next step will be to sniff the usb to serial interface and may get some information out of the sourcecode from the atmega16u2... Maybe I find a way to configure the source in that way that the atmega16u2 is able to read/write data from/to the icsp like hes doing it from the usb...

I seriously don't know which way might be the best one... and i guess it's "easier" to write an custom bootloader than trying to get some informations from the usb and source from the atmega.. Whats your opinion about that?

 

 

Kind regards

 

Dustin

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

Surely, it's all open-source - no need for any "sniffing" or "snooping" ?

 

And, surely, the atmega16u2 talks to the SAM's UART bootloader - not ICSP ?

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

- yeah you are right. I found the firmware from the atmega16u2 already at GitHub (link - right one?) and the needed LUFA library (link).

 

- i do not know if he talks to the SAM's UART bootloader but im pretty sure that he's talking to the ICSP, isn't he?

 

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

HobbitS wrote:
 do not know if he talks to the SAM's UART 

Again, it's all open-source; including the hardware - so look at the schematics!