Initializing USART0 on SAM4E16E

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

Hi, I have a problem with initializing USART0 interface as simple UART. USART1 works fine with the same code, what am I doing wrong?

 

Init.c -> board_init() {

...

ioport_set_port_mode(IOPORT_PIOB, PIO_PB0C_RXD0 | PIO_PB1C_TXD0, IOPORT_MODE_PULLUP);
ioport_disable_port(IOPORT_PIOB, PIO_PB0C_RXD0 | PIO_PB1C_TXD0);

...

}

 

After this code when i measure voltage on pin RX there is 1,5 V, there should be 3,3 V. On TX pin is aroun zero voltage but in pull-up mode it shut be also 3,3 V.

 

Can someone give me an advice what is wrong?

This topic has a solution.
Last Edited: Wed. May 10, 2017 - 07:17 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This has nothing to do with Studio or AVRs, I'll move it to general programming for ARM.

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: 0

Problem with UART is already solved, problem was in pull-up mode. The correct mode was IOPORT_MODE_MUX_C. UART is working now, but I am still wonder that voltage wasn't 3,3 V.