microbit-foundation / dev-docs

The content of the tech.microbit.org site
https://tech.microbit.org
Other
56 stars 70 forks source link

hardware/schematic.md - UART pins are backwards #353

Closed igoeco closed 2 years ago

igoeco commented 2 years ago

The pins for UART given in the schematic are backwards. The V2 schematic currently reads:

P0.06     UART_INTERNAL_RX 
P1.08     UART_INTERNAL_TX

The correct assignment is:

P0.06     UART_INTERNAL_TX 
P1.08     UART_INTERNAL_RX

I tried making P0.06 the Receiver pin and P1.08 the transmit pin but could not get serial communication to work. It worked when I switched. Here is a code snippet from using NRF device registers:

#include <nrf.h>
...
//pin configurations -- directions
    NRF_P0->DIR |= (1 << p6); //TX_PIN_NUMBER = p0.6);
    NRF_P1->DIR &= ~(1 << p8); //RX_PIN_NUMBER = p1.8);
// UART
    NRF_UART0->PSEL.TXD = p6;    //TX_PIN_NUMBER 0.6 = 0+6;
    NRF_UART0->PSEL.RXD = p8+32; //RX_PIN_NUMBER 1.8 = 32+8;
microbit-mark commented 2 years ago

Thanks for raising this. This appears to be a duplicate of #282, so will close in favour of the earlier issue.