UPDI programmer: how can it be tested by minimal means

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

Hello,

I want to use USB<>UART converter on CP2102 as UPDI programmer for ATmega808.

When reading the ATmega808 datasheet, I expected to check this programmer, requesting SIB of ATmega808.

As I understand, it is enough to send a BREAK (about 40ms - like two BREAKS using minimal UPDI bitrate 300bps, but without a STOP BIT in between), and then after about 4ms (not more than 13ms after BREAK) to send 0x55 0xE5 using another bitrate (9600 bps; 0x55-sync sequense, 0xE5 - SIB request) and to read the ATmega808' response.

But I only see a short pulse from the ATmega808. The time interval to the pulse after sending 0x55 0xE5 depends on the bitrate. It equals about 10*time of 1 word sending (12bits).

Is there something wrong in this sequence?

I attached the waveform:

the end of 40ms BREAK pulse - 4ms PAUSE - the sending of '0x55 0xE5':   0(start) 10101010 0(EvenParity) 11(2stopbits)   0(start) 10100111 1(EvenParity) 11(2stopbits) - 13ms - ATmega808' pulse

 

I downloaded Python and C projects for this theme from Github, so, I don't need the links to alien projects.

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Jun 29, 2022 - 04:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 13ms delay is the 128-bit guard-time @ 9600 baud. So, the '808 has detected your baudrate, waited the specified time and started to respond. It then immediately stops responding because of collision detecting.

 

Either you're forgetting to tri-state the TX pin on the CP2102 (if even supported) or you need a larger resistor value between TX and UPDI pins.

 

In my UPDI code the very first thing I do after BREAK sequence is set the CCDETDIS bit in UPDI CTRLB register. This disables the collision detection feature.

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

balisong42 wrote:
... or you need a larger resistor value between TX and UPDI pins.
1K ohms though IIRC jtag2updi has it significantly greater.

Serial port UPDI (pyupdi) | GitHub - microchip-pic-avr-tools/pymcuprog: a Python utility for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers

 

"Dare to be naïve." - Buckminster Fuller

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

balisong42 wrote:
Either you're forgetting to tri-state the TX pin on the CP2102 (if even supported) or you need a larger resistor value between TX and UPDI pins.

Thank You for answers.

My adapter is based on old IC CP2102-GMR. It doesn't support tri-state for TX.

The newer CP2102N ICs support the Open Drain state, but this is inconvenient as the Open Drain or Push-Pull states are selected by reprogramming the IC,

but I want to use the adapter not only for UPDI programming.

I'll try to add diode for TX pin.

 

Last Edited: Mon. Jun 27, 2022 - 08:22 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

balisong42 wrote:
The 13ms delay is the 128-bit guard-time @ 9600 baud. So, the '808 has detected your baudrate, waited the specified time and started to respond. It then immediately stops responding because of collision detecting.

Thank You very much, Your answer helps me to suppose, that the problem possibly is in adapter<>UPDI connection.

I changed the connection

adapter/Tx > 1k5 > M808/UPDI pin (also I tested 4k7 and 11k)

to

adapter/Tx > Shottki diode/cathode; anode > to adapter/Rx and through 470 Ohm > M808/UPDI pin

and M808 started to answer.

This connection is recommended here:

https://github.com/SpenceKonde/A...

Last Edited: Wed. Jun 29, 2022 - 04:06 AM