MEGA128 + USB + BOOTLOADER

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

Hi,
I have to implement a USB interface between a mega128 and a PC, both to up/download data, and also to do the firmware update with the bootloader.
I think i will chose the FT232BM chip.
Im not sure yet if this is an easy task or a difficult one. I have good experience with AVRs, but I have never used USB or bootloader.

Do you have any good experiences in doing this that you can share?

Thanks

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

Yes, it's pretty easy.
See the yampp projects.
yampp.com

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

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

Hello,
I am also interested in using the same FTD chip on an Atmega128. Please let me know if you have succeeded in implementing the circuit. How to control the communication speed (number of bits per second) and also how to mak Windows auto detect the USB device?
Thank you.
Regards

Parthasaradhi Nayani

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

The coms speed that the FT232 talks at is controlled by the PC settings in terminal or whatever. Therefore you must match the speed the PC talks to the FT to the UART settings in the M128. You don't even need a MAX232 to level shift - the FT232 gives you TTL level signals at either 5V or 3V depending on how you wire it up - it has a user wireable Voltage-IO pin.

When you install the two drivers, windows will automatically detect the FT232 and dynamically add a serial com port to your PC, every time it is plugged into the system. You need to keep the serial eeprom so the PC can auto detect the FT232 otherwise you have to plug it into the same USB channel each time.

It is so idiot proof even I got it all sussed in less than an evening. The only problem is the numbering of the com port if like me your laptop has multiple bluetooth profiles then you end up with the FT232 being numbered com27 or something equally stupid.

Murdo.

There are already a million monkeys in front of a million keyboards, and the internet is nothing like Shakespeare!

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

Quote:
...you end up with the FT232 being numbered com27 or something ...

The current FTDI PC-side driver lets you go into Device Manager-Ports-COMM Ports-Properties [of the FTDI "discovered" port] and change the COMn number.

We've got the FTDI chips in a couple apps with good results.

As a side project recently, we took a "leftover" FT232BM + MAX485 and made a no-micro USB-to-RS485 converter. (Most of our industrial apps are RS485, but everything here would apply to RS232 as well).

In our case, this replaces a $20 USB-to-Serial converter plus an $80 RS232-to-RS485 converter. The cost includes $5 FT232BM, $1 MAX485, USB receptacle, screw terminal block or other attachment for RS485 wires, circuit board, case, and about a dozen passives--diodes, inductors, resistors, caps.

The designs were taken from the FTDI applications guide.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Hi,
Thanks a lot for the info. But what is this driver you are talking about? Is it possible to configure the com speed of the USB?

Regards

Parthasaradhi Nayani

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

Sometimes the USB <-> Serial convertors have different transmit latencies than traditional RS232, hence autodetect systems might not wait long enough for the packet to be transmitted, processed and returned by the host being detected.

I was caught out with some previous USB-RS232 convertors: if you changed the baud rate before transmision of the previous packet is complete, they fell over. I did a VB program that transmitted a large packet of data then immediately set the com port to a new baud rate and the baud rate on the output of the USB-RS232 device changed half way through serialising the data stream and corrupted its own transmission.

Lee - I found the COMx? solution myself pretty quickly after RTFM kicked in, but a lot of programs have an upper limit as to the com port they will address and unless you can shuffle the other virtual com ports around (which I couldn't) then you get into a bit of a mess. eg AVRStudio: no matter what you enter in the option window, it just won't go above COM10 (or rather I haven't been able to make it...)

Murdo.

There are already a million monkeys in front of a million keyboards, and the internet is nothing like Shakespeare!