ATmega4809 Xplained Pro USB USART

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

Do I have it right that if I send anything out on USART1 it should come out of the USB/CDC port? (Com21 on mine)

 

Is there anything that needs to be bridged? It seem not.

This topic has a solution.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Thu. Jun 14, 2018 - 03:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's usually the way.

 

(haven't tried mine yet)

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmm nothing is coming out but I have just modified my ASM driver for USART1, the version for USART0 was working with the Tiny817 and they seem to be the same type of USARTs.

 

I'll try USART0 on PA0 and PA1 with one of my TTL/RS232 boards.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

USART0 is now working, need to set up TXD as output like the Xmegas. Also the clock defaults to 3.333 MHz.

 

Nothing on USART1/CDC/USB com port.

 

EDIT of course needed to update Studio to 1645 but don't rely on breakpoints working!! angry

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Wed. Jun 13, 2018 - 07:13 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does it need any of the flow control signals asserted ... ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And finally for the night I can't get the memory mapped data to print, going to the "data MAPPED_PROGMEM" I can't see the string to print, it is there in normal PROGMEM LPM style.

 

With the Tiny817 it was retrievable by using

	ldi		zl, low ((Button_pressed * 2) - 0x8000)
	ldi		zh, high ((Button_pressed * 2) - 0x8000)

but this only prints garbage.

 

Maybe tomorrow.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

but since it has more than 32K flash it must start lower. 0x4000 would be my guess (RTFM)

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

Does it need any of the flow control signals asserted ... ?

Just tried with both RTS and DTR asserted, no cigar.

0x4000 would be my guess (RTFM)

Also no cigar. Nothing at where Z is pointing to. I'm ASS-U-MEing that this window would show the 2 strings I have in the code. I can see the 2 strings in normal progmem and both string work using LPM.

 

 

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Never mind about the USB/CDC output, I had a copy and paste bug and it was till initializing USART0 instead of USART1 blush all is well with that.

 

Maybe I'll start another thread about the memory mapped printing if I can't find it myself.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly