FAQ
- M051 Base Series(95)
- M0518 Series(97)
- M0519 Series(43)
- M0564 Series(1)
- Mini51 Base Series(90)
- Nano100/102 Base Series(101)
- Nano103 Base Series(10)
- Nano110/112 LCD Series(100)
- Nano120 USB Series(111)
- Nano130 Advanced Series(110)
- NUC029 Series(94)
- NUC100/200 Advanced Series(102)
- NUC120/122/123/220 USB Series(116)
- NUC121/125 Series(1)
- NUC126 USB Series(2)
- NUC130/230 CAN Series(103)
- NUC131/NUC1311 CAN Series(98)
- NUC140/240 Connectivity Series(114)
- M451 Base Series(118)
- M451M Series(117)
- M452 USB Series(130)
- M4521 USB Series(1)
- M453 CAN Series(128)
- M463 CAN FD/USB HS Series(1)
- M467 Ethernet/Crypto Series(1)
- M471 Series(1)
- M479 Motor Control Series(1)
- M481 Base Series(4)
- M482 USB FS OTG Series(4)
- M483 CAN Series(4)
- M484 USB HS OTG Series(4)
- M485 Crypto Series(4)
- M487 Ethernet Series(4)
- M4TK Touch Key Series(25)
- NUC442/472 Series(130)
- NUC472 Series(1)
- NUC505 Series(138)
FAQ
How to change the N76E003 HIRC frequency for more accurate UART transmission? Issue Date:2016-12-22
The N76E003 HIRC frequency is 16 MHz and the deviation is less than 1% at room temperature. When using the baud rate up to 38400 for UART transmission, 16 MHz cannot be divided by 38400 Hz, such that baud rate deviation is too large and the transmission cannot be stabilized.
At this time, user can change the HIRC frequency to 16.588 MHz to produce an accurate baud rate.
- The steps of changing the HIRC frequency are as follows:
- Trim value = RCTRIM0(HIRCTRIM[8:1]) + RCTRIM1(HIRCTRIM[0])
Adjust the HIRC frequency to 16.6 MHz;
- Write the calculated value back to RCTRIM0 and RCTRIM1, and the HIRC change will take effect immediately after writing;
- The HIRC will revert to 16 MHz after each power-up, and the user needs to change the HIRC by writing the SFR.
- Recalculate the baud rate based on 16.588 MHz and set the baud rate generated by the timer to meet the standard baud rate.
- Example samples:
sfr RCTRIM0 = 0x84;
sfr RCTRIM1 = 0x85;
bit BIT_TMP;
#define set_IAPEN BIT_TMP = EA; EA=0; TA=0xAA; TA=0x55; CHPCON |= SET_BIT0; EA= BIT_TMP
#define set_IAPGO BIT_TMP = EA; EA = 0; TA = 0xAA; TA = 0x55; IAPTRG |= SET_BIT0; EA = BIT_TMP
#define clr_IAPEN BIT_TMP = EA; EA = 0; TA = 0xAA; TA = 0x55; CHPCON &= ~SET_BIT0; EA=BIT_TMP
unsigned char hircmap0,hircmap1;
unsigned int trimvalue16bit;
void MODIFY_HIRC_VLAUE(void)
{
set_IAPEN;
IAPAL = 0x30;
IAPAH = 0x00;
IAPCN = READ_UID;
set_IAPGO;
hircmap0 = IAPFD;
IAPAL = 0x31;
IAPAH = 0x00;
set_IAPGO;
hircmap1 = IAPFD;
clr_IAPEN;
trimvalue16bit = ((hircmap0<<1)+(hircmap1&0x01));
trimvalue16bit = trimvalue16bit - 15;
hircmap1 = trimvalue16bit&0x01;
hircmap0 = trimvalue16bit>>1;
TA=0XAA;
TA=0X55;
RCTRIM0 = hircmap0;
TA=0XAA;
TA=0X55;
RCTRIM1 = hircmap1;
}
Products: | Microcontrollers ,8bit 8051 MCUs ,Low Pin Count 8051 Series ,N76E003 |
---|---|
Applications: | |
Function: | Peripherals,Clock Control,HIRC,Connectivity,UART |