Update on my Not So Secret Project

I’m not sure if I should be upset or thrilled that my week-or-two-long side project to turn the USB AVRs into an AVRISP-MKII seems to have garnered more interest that the LUFA stack it it built on. Nevertheless, it’s time for an update on the status of the code.

I’ve now completed the initial release of the AVRISP project, downloadable in a convenient package from this AVRFreaks thread, or in the latest SVN revision. I’ve tested it personally on both a AT90USB647 and a AT90USB162, both of which seem to work perfectly on an ATMEGA644 target. There are still some caveats, however:

1) Hardware SPI only for programming the target, so a minimum target frequency of 500KHz is required

2) No short-circuit or reversed target connection detection (yet)

But it does work and it does make a pretty darn decent AVR programmer in only a few seconds. I’m still working out how to build a simple (read: cheap!) level converter for 5V/3V target programming, so if you have any ideas, please leave a comment.

Special thanks goes to “Mike” who commented on the previous entry about the project, who performed testing/debugging of the code on the AT90USB162 target and 64-bit Windows OS.

 

Comments: 3

Leave a reply »

 
 
 

Hi Dean,

> Iā€™m still working out how to build a simple (read: cheap!) level converter for 5V/3V target programming, so if you have any ideas, please leave a comment.

Basically we have two choices:

1) Use a programmer-powered target, which means that the power supply to the target as well as the levels on the I/O lines meeds to match what the target is expecting. You will need a voltage reduction circuit of some sort on the programmer for 3.3V targets, as well as a way to switch from 3.3V to 5V as required.

2) Use a self-powered target hooked up to the programmer. This means that the power supply is not an issue, and we only have to level-shift the I/O lines.

As I mentioned in the other comment thread, I’m using option 2, and this circuit works for me for programming 3.3V targets:

http://www.ett.co.th/download/03AVR/03A09/ET_AVR%20ISP_Schematic.pdf

The connector on the right (ET-PSPI) goes to the target. The power supply of the target powers the buffer chip through the isolation diode. While its labelled 5V, it will also work at 3.3V.

The other connector (ET-CAB10P) goes to the USB Atmel chip that is running Dean’s code. This will be running at 5V – powered from the USB host. However, we don’t connect the VCC lines together, so there is isolation between the target and programmer.

If are programming a 5V target, then it’s pretty simple. Both the target and the programmer are running at 5V and there is no level shifting involved.

If we are programming a 3.3V target then the buffer chip is powered by 3.3V from the target. The programmer is running at 5V, and will present 5V signals to the input of the buffer chip. But because the buffer chip is supplied by 3.3V from the target, the output of the buffers (which are driving the target lines) will not exceed 3.3V. The buffer chip is also robust enough to handle inputs above its VCC supply voltage from the 5V programmer.

In the other direction (i.e. towards the programmer), the buffer chip will output 3.3V signals, but because they are still in the correct voltage range for High and Low on the 5V programmer, the programmer will see the ones and zeroes on its input correctly.

So with option 2 there is no voltage switching required, and no complicated power supply issues. You can buy the circuit pre-made at Futrulec for US$5.90, bit it’s pretty easy to make it yourself: http://www.futurlec.com/ET-AVR_Stamp.shtml

Hope this helps.

Mike

P.S. Don’t be concerned that this project seems to have generated more interested than LUFA – it’s only a perception caused by my voluminous comments šŸ™‚ I’m still waiting with anticipation for the host-side LUFA library updates, and this was a good way to pass the time.

 

I’d suggest using some of those:
http://www.analog.com/en/interface/level-translators/products/index.html
or
http://www.analog.com/en/interface/digital-isolators/products/index.html

IMHO isolator would be best for real programmer as live targets could be safely programmed. Ground loops can get you into trouble easily…

BTW, I’m interested doing the HW design if you do the SW design šŸ™‚

 

All the USB AVRs can run at 3.3V when using an 8MHz crystal. The AT90USB162’s internal regulator can even supply 50mA to external devices in addition to powering itself at 3.3V.

 

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS