ARM LPC2129 Mini Development Board – BUZZER Interfacing
The “ARM LPC2129 Mini Development Board – BUZZER Interfacing” wiki discussed here is in reference to the rhydoLABZ make LPC2129 Development Board-Mini, however it makes no difference even if the board used is either LPC2138 Development Board-Mini or LPC2148 Development Board-Mini.i.e, this interfacing guide is common for LPC2129/LPC2138/LPC2148 Mini Development Boards from rhydoLABZ.
ARM LPC2129 Mini Development Board has an on-board buzzer connected to port pin P0.21 via jumper J10. To use the buzzer, it is necessary to short the jumper. If P0.21 is to be used for any other purpose, then the jumper should be left open.
Schematic:
Sample code to test the on-board buzzer is given below. As per the code given below, when the switch SW1 is pressed, it generates interrupt and toggles the status of buzzer.
Sample Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
/****************************************************************************************** HEADER FILES *******************************************************************************************/ #include<lpc21xx.h> /****************************************************************************************** INTERRUPT SERVICE ROUTINE *******************************************************************************************/ void Ext_Interrupt(void)__irq { EXTINT = 0X02; /* Clear interrupt flag */ IO0PIN = (IO0PIN ^ 0X00200000) & 0x00200000; /* Toggle P0.21 on every interrupt */ VICVectAddr = 0x00000000; /* Acknowledge Interrupt */ } /****************************************************************************************** * Function : Init_Ext * * * * Description : Function for initialising interrupt * * * * Parameters : None * *******************************************************************************************/ void Init_Ext(void) { PINSEL0 |= 0X20000000; /* Enable EXT1 */ EXTMODE = 0X02; /* Edge sensitive */ EXTPOLAR = 0X02; /* Rising edge */ VICVectAddr0 =(unsigned int)Ext_Interrupt; /* Set Interrupt Vector in 0 */ VICVectCntl0 = 0x0000002F; /* Use it for EXT1 Interrupt */ VICIntEnable = 0x00008000; /* Enable EXT1 INTERRUPT */ } /****************************************************************************************** MAIN FUNCTION *******************************************************************************************/ int main(void) { IO0DIR = 0X00200000; /* P0.21 configured as output */ Init_Ext(); while(1); } |
Topics related to ARM LPC2129 Mini Development Board:
- ARM LPC2129 Mini Development Board – Overview
- ARM LPC2129 Mini Development Board – LED Interfacing
- ARM LPC2129 Mini Development Board – LCD Interfacing
- ARM LPC2129 Mini Development Board – UART0 Interfacing
- ARM LPC2129 Mini Development Board – UART1 Interfacing
- ARM LPC2129 Mini Development Board – Switches Interfacing
- ARM LPC2129 Mini Development Board – BUZZER Interfacing
- ARM LPC2129 Mini Development Board – POT Interfacing (ADC)
- ARM LPC2129 Mini Development Board – Temperature Sensor Interfacing(ADC)
- ARM LPC2129 Mini Development Board – Interfacing Servo motor
- ARM LPC2129 Mini Development Board – CAN Interfacing
Resources:
- Softwares
- Datasheets
How to buy:
- Click here to buy rhydoLABZ ARM LPC2138 Mini Development Board
- Click here to buy rhydoLABZ ARM LPC2148 Mini Development Board
- Click here to buy rhydoLABZ ARM LPC2129 Mini Development Board
Support:
Please share your ideas with us, visit our forum for discussion
Leave a Reply
You must be logged in to post a comment.