Can I use mini-USB of UC3B to program?

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

Finally, I finished building my designed experiment boardwithAT32UC3B0512.

However, when I want to flash the program inside, there is a question occurred to me. Which way of programming is cost-effective or effective? How?

I thought that the USB was the cheapest way for I dont need to buy MKII or UART TTL USB. But.. How can it be done in AS7?

If someone has some other methods other than Jtag, it may be another cost-effective way.

Thank you. 

 

Frank

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

To use USB to program, you will need a bootloader program in your micro, and something on your pc to talk to it! 

But you will need some type of ISP (jtag) to load the initial bootloader code into the micro.....   something of the chicken or the egg situation!

 

As has been said here many times, an Arduino is a great way to get started, proven h/w, easy to use, and you can use it as your first ISP programmer to load your bootloader in your next project.

Solves the egg/chicken problem!

 

Jim

 

 

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

You have JTAG; use it!

 

Not just for programming - also for debugging.

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

So does it mean that I have to get a Jtag debugger which is much more expensive than my board?

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

A JTAG debugger is an investment - no developer should be without one!

 

If cost is an issue, why not just get one of the many cheap dev boards available these days with the debugger built in?

(ISTR that has been suggested to you in the past?)

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

Unless chips are supplied with some kind of bootloader already programmed in then you always need some kind of programmer/debugger to get the first code in even if that's going to be a bootloader so you can then switch to another programming mechanism.
.
Now in the AVR8 series of chips it is only (most of) the chips with USB that Atmel supply with bootloader code preprogrammed.
.
I know nothing about the almost pointless UC3 series of AVR32 but just maybe Atmel might preload them with USB-DFU bootloader code. What does the datasheet say?

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

Yes, I found a document about USB DFU of AT32UC3B. It said that a bootloader is preprogrammed after factory.

By default, all parts are shipped with the bootloader, so there is no need to program it, except if
it has been erased with the JTAGICE mkII using a JTAG Chip Erase command (avr32program
chiperase) or if the user wants to program a previous version.

However, when I did what the document said, my computer shows no reaction.

For instance, with the default configuration
on EVK1100 or EVK1101, press the reset push-button, then maintain the joystick
pressed while releasing the reset push-button. This will open a new hardware installation window.

, where 'pressing the joystick' is to press PA13.

As you can see in my scheme, I have already set the reset and NMI(PA13)(by default) switch. Are there any other things not fine in my board or computer(Win 10)? Or must I use Jtag to reprogram it?

And another very serious question comes out: how to program it when it needs to be batch produced without JTAG port?

 

 

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

So in EVK1100 (01) what does "pressing the joystick" do. You clearly need to mimic the same signal.

 

The way most chips with DFU (USB) work is that usually when reset the DFU bootloader does not run. You want it like this so that what actually starts is the USB code in your application that might choose to appear as CDC or MSD or MIDI or whatever. You don't want the AVR to appear as a DFU. But every once in a while, when you start you actually want to reprogram the chip and on those occasions you do want the bootloader to run so it starts up as DFU. Clearly in EVK1100 it is the joystick button that says "DFU not anything else". So you likely need that same type of selection.

 

EDIT: googling suggests the EVK1100 schematic is here: http://www.atmel.com/Images/EVK1...

 

EDIT2: So it appears this is how the joystick is connected:

 

Now I don;t know the part used but I *think* that is saying that a press on CTR (center button?) will be connecting EXTINT to Gnd. So it looks like that is the trigger, at reset, to make the UC3 enter the DFU bootloader.

Last Edited: Wed. Aug 23, 2017 - 02:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK so you need to read and understand this it seems:

http://www.atmel.com/Images/doc3...

 

In particular Chapter 6 and especially the table 6-2

 

So it all depends what ISP_IO_COND_PIN in bits 15:8 of the user config word 2 are set to by default. For example it tells us:

 

so it's going to kind of depend as to what the default state of config word 2 is in your UC3 as to which pin it is looking for to activate the DFU at power on.

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

I pulled the datasheet for AT32UC3B0512. The key detail in the entire thing is:

 

 

So your "magic number" is 0x929E0D6B. As the previous PDF told you (7.3.2.2) if it starts 0x929E then it is "active low". Can't immediately work out which is the activation pin but I'll leave that to you...

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

 

According to USB DFU documentation, it is port 13 with condition 0. (It doesn't actually work!)

10010010100111100000110101101011   (31-0)

However, when I checked the General-Purpose fuse bits...

6.2.1 General-Purpose Fuse Bits
The AVR UC3 have 32 general-purpose fuse bits. When these bits are erased, they are at 1b.
The AVR UC3 devices are shipped with:
• For AVR UC3 A0, A1: the general-purpose fuses set to FC07FFFFh.
• For AVR UC3 A3: the general-purpose fuses set to FFF7FFFFh.
• For AVR UC3 B0, B1: the general-purpose fuses set to FC07FFFFh.

, which makes ...

11111100000001111111111111111111  (31-0)

ISP_FORCE is 1, which means:

When at 1, tells the boot process to start the
USB DFU ISP without testing any other
condition.

So it means that DFU is triggered as soon as it starts? So why doesn't my computer recognize the chip?

Or.. my chip has been changed by some stores after the factory, or it is caused by different revisions?

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

Oh, the frequency of my crystal is 16MHz, does it affect the ISP?

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

I only use XTAL1... I should check the fuse bit that enables the crystal source. But the datasheet says:

After power-up, the device will be held in a reset state by the Power-On Reset circuitry, until the
power has stabilized throughout the device. Once the power has stabilized, the device will use
the internal RC Oscillator as clock source.

, which seems that it may not the problem of the crystal source.

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

http://www.atmel.com/Images/Atmel-32095-AVR-UC3B-32bit-Microcontroller-Schematic-Checklist_AP-Note_AVR32715.pdf

This is the reference which I used to design the board, and the PA13 is the bootloader enable pin that is announced in. I think that it is the meaning of 'pressing the joystick'.

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

OK so if you just wire up D+/D- from the micro to a USB port on your PC does it immediately enumerate as a DFU?

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

no