Skip to content

HardwareSerial BUG Rx pin floating input #48

Closed
@Makeblock-official

Description

@Makeblock-official

Rx pin should be set to the pull-input at begin

fix this bug as follows
file Uart.cpp line 37

void Uart::begin(unsigned long baudrate, uint8_t config)
{
  pinMode(uc_pinRX,INPUT_PULLUP);//Rx pin set INPUT_PULLUP mode,
  pinPeripheral(uc_pinRX, g_APinDescription[uc_pinRX].ulPinType);
  pinPeripheral(uc_pinTX, g_APinDescription[uc_pinTX].ulPinType);

  sercom->initUART(UART_INT_CLOCK, SAMPLE_RATE_x16, baudrate);
  sercom->initFrame(extractCharSize(config), LSB_FIRST, extractParity(config),        extractNbStopBit(config));
  sercom->initPads(uc_padTX, uc_padRX);
  sercom->enableUART();
}

file SERCOM.cpp line 118

void SERCOM::clearStatusUART()
{
  //Reset (with 0) the STATUS register
  //sercom->USART.STATUS.reg = SERCOM_USART_STATUS_RESETVALUE;
   sercom->USART.STATUS.reg = 0xFF;//Writing a zero to this bit has no effect.,Writing a one to this bit will clear it.
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions