This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include β../FlashOs.Hβ | |
| // Memory Mapping Control | |
| #define MEMMAP (*((volatile unsigned char *) 0x E01FC040)) | |
| // Phase Locked Loop (PLL) | |
| #define PLLCON (*((volatile unsigned char*) 0xE01FC080)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Example for Real time clock | |
| // Description : Example for display via Terminal program time format hh:mm:ss | |
| // : and user can setup new time by press key β*β on keyboard | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : rtc_setup.c | |
| // C compiler : Keil CARM Compiler | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| #include βlpc214x.hβ // Header file for Phillips LPC2148 controller | |
| #include βstdio.hβ // Library for use puts function(For UART1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Note: | |
| the operation of this experiment RTC module cannot operate | |
| continuous without supply voltage. Because the program set to RTC clock use | |
| same souce clock of CPU (CLKSRC bit in CCR register is β0β). RTC module will operate | |
| when apply supply voltage to CPU only | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Example for Real time clock | |
| // Description : - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Example Analog to Digital converter | |
| // Description : Display A/D convert value on terminal program(used UART0 | |
| // : communication) | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : adc.c | |
| // C compiler : Keil CARM Compiler | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| #include βlpc214x.hβ // Header file for Phillips LPC2148 controller | |
| #include βstdio.hβ // Library for sprintf function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : UART example | |
| // Description : Example for test UART1 interrupt mode | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : uart_int.c | |
| // C compiler : Keil CARM Compiler | |
| //βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| #include βlpc214x.hβ // Header file for Phillips LPC2148 controller | |
| #include βuart.hβ // Library for use module UART0,UART1 | |
| #include βstdio.hβ // Library for use puts function(For UART1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Transmit Data from UART0/UART1 module on LPC 2148 | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Library for serial communication(UART) | |
| // Description : Library for about serial communication UART0 and UART1 of LPC2148 | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : uart.h | |
| // C compiler : Keil CARM Compiler | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| #define _PCLK 30000000 // Define PCLK for configuration baudrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Example for EINT2(External interrupt2) | |
| // Description : Test interrupt from switch press display by LED at P0.21 | |
| // : toggle and sound beep | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : ext_int2.c | |
| // C compiler : Keil CARM Compiler | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| #include βlpc214x.hβ // Header file for Phillips LPC2148 controller | |
| #include βsound.hβ // Header file for Phillips LPC2148 controller |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| LPC2148 port acts input for reading data | |
| from P0.28 and P0.29 that connected with push-button switches and resistor pull-up | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// | |
| // Program : Example for test switch | |
| // Description : Test switch at P0.28 and P0.29 for toggle LED at P0.21 and P0.22 | |
| // Frequency : Crystal 12 MHz at PLL 5x(CCLK = 60 MHz),PCLK = 30 MHz | |
| // Filename : switch.c | |
| // C compiler : Keil CARM Compiler | |
| //ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Reference user manual : | |
| http://www.keil.com/dd/docs/datashts/philips/user_manual_lpc2119_2129_2194_2292_2294.pdf | |
| /* WDT [Watch Dog Timer] driver for LPC2129 */ | |
| #include <LPC210x.H> /* LPC210x definitions */ | |
| extern void init_serial (void); /* Initialize Serial Interface */ | |
| extern int sendchar (int ch); /* Write character to Serial Port */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Reference user manual : | |
| http://www.keil.com/dd/docs/datashts/philips/user_manual_lpc2119_2129_2194_2292_2294.pdf | |
| /*Serial interfacing for LPC2129 [NXP] UART1*/ | |
| #include <LPC210x.H> /* LPC21xx definitions */ |
OlderNewer