RM - N76E003 CMSIS BSP Guide v1.06

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

N76E003

N76E003 BSP Guide


Directory Introduction for Nuvoton 8051 Family

Directory Information
Please extract the “N76E003_BSP_Keil_C51_V1.0.6.zip” file firstly, and confirm the
following folder all contain.
This BSP folder contents:

Document Driver reference manual and reversion history.

Common The common usual subroutine include Timer delay and basic
UART baud rate setting

Include All include header file and define

Sample_Code Driver sample code.

Startup Startup file for N76E003

The information described in this document is the exclusive intellectual property of


Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton.

Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system design.
Nuvoton assumes no responsibility for errors or omissions.
All data and specifications are subject to change without notice.

For additional information or questions, please contact: Nuvoton Technology Corporation.


www.nuvoton.com

Jul 02, 2018 Page 1 of 9 Rev 1.06


N76E003

1 .\Document\

Nuvoton_N76E003_BSP_ This document shows the revision history of N76E003 BSP.


Revision_History.pdf

Jul 02, 2018 Page 2 of 9 Rev 1.06


N76E003

2 \Common

UART0 Baud rate setting base on Time 1 or Timer 3,


Common.c
UART1 baud rate setting base on Timer 3

Timer0_Delay100us, Timer0_Delay1ms,
Delay.c Timer1_Delay10ms, Timer2_Delay500us,
Timer3_Delay100ms setting

Jul 02, 2018 Page 3 of 9 Rev 1.06


N76E003

3 \Include

Common.h Header file to extern function for Common.c

Delay.h Header file of extern function for Delay.c

Function setting include GPIO initial, External pin interrupt


Function_Define.h trig mode, Timer value common value define, Timer 2
capture enable, PWM initial, ADC initial

N76E003.h N76E003 SFR define header file

Extend N76E003 define for no-bit-addressable SFR with bit


SFR_Macro.h
enable or disable function.

Jul 02, 2018 Page 4 of 9 Rev 1.06


N76E003

4 \Sample_Code

ADC_Bandgap ADC band-gap input demo code

ADC converts demo code with band-gap value to calculate


ADC_Bandgap_VDD_noD
the VDD value. Add 5 times average value test and judge
elay
bandgap mark to find the best value for calculate.

ADC_IO_Trig ADC trig start polling or interrupt by special I/O

ADC_multi_channel ADC different channel input alternate demo code.

ADC convert 16 times average value to get an optimized


ADC_Optimizing_16x
value of the ADC convert result

ADC_PWM_Trig ADC trig start by PWM cycle finish

ADC_Simple ADC trig start polling or interrupt by SFR start bit

Clock_Out N76E003 HIRC clock out setting

Fsys_Select System clock select demo

All GPIO quasi / push pull/ input only/ open drain four status
GPIO
initial setting and toggle out

I2C module connect with external EEPROM read writer


I2C_EEPROM
demo

Two piece of N76E003 I2C module connect, the master and


I2C_Master-Slave
slave demo code

IAP_AP-program- IAP run in APROM to program APROM demo code, It’s also
AP_Dataflash used as program data flash area.

Customer use this macro, each time call this subroutine, can
IAP_Dataflash_EEPROM use Data flash as EEPROM mode, the process include read
old data / erase / modify new code/ write in.

IAP run in LDROM to program APROM. This function is use


IAP_LD-Program-AP
in ISP function.

The function to modify HIRC value to 16.6MHz for UART


IAP_ModifyHIRC
baud rate over 38400 application system.

IAP_program_Config Use code IAP function to modify CONFIG area.

Jul 02, 2018 Page 5 of 9 Rev 1.06


N76E003

Use IAP command to read actually band-gap value for each


IAP_Read_Bandgap
N76E003.

IAP_Read_UID Use IAP command to read the UID of each N76E003.

IAP_Read_UCID Use IAP command to read the UCID of each N76E003.

Each GPIO of N76E003 can use as external interrupt pin.


Pin_Interrupt
Trig IC wakeup from idle / power down mode.

PWM_DeadTime PWM output with dead time insert initial setting

PWM_INT PWM output with interrupt subroutine

PWM_Simple Simple PWM output setting initial

SPI_Flash Read / writer W25Q16 sample code.

SPI connect with two N76E003, Include master and slave


SPI_Master-Slave
sample code, use interrupt and polling.

Timer01_mode_0 Timer 0 and Timer 1 mode 0 demo code

Timer01_mode_1 Timer 0 and Timer 1 mode 1 demo code

Timer01_mode_2 Timer 0 and Timer 1 mode 2 demo code

Timer01_mode_3 Timer 0 and Timer 1 mode 3 demo code

Timer2_AutoReload_Capt
Timer 2 capture with compare function demo code
ure

Timer2_AutoReload_Delay Timer 2 auto reload mode for delay function demo code

Timer3 Timer 3 delay counter demo code

UART0 UART0 demo code

UART0_mode_3 UART0 mode 3 with TB8/RB8 function

Setting send from UART0 TX pin when call printf function


UART0_printf
sample project.

UART1 UART1 demo code

Setting send from UART1 TX pin when call printf function


UART1_printf
sample project.

Jul 02, 2018 Page 6 of 9 Rev 1.06


N76E003

WakeupTimer_INT Wakeup timer with interrupt subroutine demo code

Watchdog_INT Watch dog without reset, only interrupt function initial

Watchdog_Reset Watch dog reset MCU function setting initial

Use IAP command to modify CONFIG WDT reset setting,


Watchdog_Reset_Disable disable WDT reset function. Once WDT reset is setting
enable by CONFIG, only this way can disable it.

XRAM 768 bit test, assembler and c code compiler in one


xRAM_768B
project demo

Jul 02, 2018 Page 7 of 9 Rev 1.06


N76E003

5 REVISION HISTORY
Date Revision Description

2016.12.28 1.00 Initially issued.


1. Added HIRC modify
2017.2.1 1.01 2. Added SPI master / slave control demo code include
interrupt and polling
1. Added POR disable instruction in startup.a51
2. Added ADC read band-gap and calculate VDD value
2017.6.20 1.02 demo
3. Added ADC 16 times optimize demo
4. Added read UCID sample code
1. Modified ADC read band-gap and calculate VDD
2017.9.26 1.03 value demo

2017.12.28 1.04 1. Added Watchdog_Reset_Disable demo.


1. Added printf_UART1 demo project
2018.1.29 1.05 2. Removed ADD_Bandgap_VDD project, added
ADD_Bandgap_VDD_noDelay project
1.Modiied printf_UART1 to UART1_printf
2018.7.2 1.06 2.Added “UART0_printf” project
3.Added “ADC_multi_channel” project

Jul 02, 2018 Page 8 of 9 Rev 1.06


N76E003

Important Notice
Nuvoton Products are neither intended nor warranted for usage in systems or equipment, any
malfunction or failure of which may cause loss of human life, bodily injury or severe property damage.
Such applications are deemed, “Insecure Usage”.
Insecure usage includes, but is not limited to: equipment for surgical implementation, atomic energy
control instruments, airplane or spaceship instruments, the control or operation of dynamic, brake or
safety systems designed for vehicular use, traffic signal instruments, all types of safety devices, and
other applications intended to support or sustain life.
All Insecure Usage shall be made at customer’s risk, and in the event that third parties lay claims to
Nuvoton as a result of customer’s Insecure Usage, customer shall indemnify the damages and liabilities
thus incurred by Nuvoton.

Jul 02, 2018 Page 9 of 9 Rev 1.06

You might also like