• AVR Freaks

Hot!PIC32MZ EH Harmony3 UART is Bug?

Author
YutaKitagami
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/03/20 01:44:01
  • Location: 0
  • Status: offline
2019/03/31 19:33:32 (permalink)
0

PIC32MZ EH Harmony3 UART is Bug?

Hi!
I'm using Harmony3 for development.
The microcomputer is PIC32MZ2048EFH064.
 
File Name: plib_uart1.c (Don't enable Intarrupts)
* This source is very good!!

bool UART1_Write( void *buffer, const size_t size )
{
bool status = false;
uint8_t * lBuffer = (uint8_t *)buffer;
size_t processedSize = 0;
if(NULL != lBuffer)
{
while( size > processedSize )
{
if(!(U1STA & _U1STA_UTXBF_MASK))
{
U1TXREG = *lBuffer++;
processedSize++;
}
}
status = true;
}
return status;
}

* This source is don't work!!!(very bad.)

void UART1_WriteByte(int data)
{
while (!(U1STA & _U1STA_UTXBF_MASK));
U1TXREG = data;
}


* Please change to this source.
while (!(U1STA & _U1STA_UTXBF_MASK)); --> while (U1STA & _U1STA_UTXBF_MASK);
Thank you. :)

P.S.
There was a spelling error in Harmony3 GUI of UART.
UART - Enable Intarrrupts.
#1

0 Replies Related Threads

    Jump to:
    © 2019 APG vNext Commercial Version 4.5