 Hello everyone, Myself Kitshwara Stambe working as an assistant professor in Department of Electronics Engineering at Valchin Institute of Technology, Solapur. Let us learn the general purpose IOPORT registers of LPC176 set. So at the end of the session students will be illustrated the structure of GPI related memory map registers of LPC176 set and they can able to drive logic high or logic low on any output pin which is configured as a GPIO outline. So we know that in LPC176 set total up to 17 GPIO pins are available for the user through five general purpose bi-directional IOPorts which are port 0 to port 4. Normally GPIO pins are used to interface general purpose IO devices like LEDs, switches, relays, LCDs. So GPIO port pins control through five group of memory map registers. So in the previous session we learn how to set the direction of any GPIO port pin for the input or output. In this session we will learn the remaining registers, fast IO mask register, fast IO set register, fast IO clear register, fast IO pin value register. So GPIO port mask registers. So in this session we will learn word accessible 30 bit wide fast IO mask register. This register selects the port pins that will or will not be affected by writing the values in fast IO pin value register, fast IO set register, fast IO clear register. The meaning is if you write 0 for any particular port pin the control pin is affected by the writings in registers like fast IO set, fast IO clear and fast IO pin value register. If you write 1 then that control pin will not be affected by any writings in the above registers. Next GPIO port output set register. Again this is word accessible 30 bit wide. Control the state of each port pin of port X. So we have here 5 sets, fast IO 0 set register to fast IO 4 set register. So these are all re-writeable. These are the memory addresses with which you can access these registers. The reset values are all 0s for all these registers. Refer standard header file lpc17xx.h for the standard definition of all these registers. While writing the program. So this word accessible fast IO set register controls the state of each port pin of port X. By writing 1 produces high on that corresponding port pin. If you write 0 then there is no effect on the output. Reading this register returns the current contents of the port register. Again only the bits enabled by 0 in the mask register can only be altered. So let us learn one example how to use this register. So let us set port 0 pin p0.4 to high. So this is a 30 bit format and we want port pin p0.4 high. We should write here 1. So let us calculate the hex value for the above combination. Fast IO set register is equal to 0x00010. We will force logic high on p0.4. You can use this convention also. One is left shifted by 4 bits. Next is GPI port output clear register. So this register is again used to control the state of each port pin of port X. We have here again 5 set of registers. Fast IO 0 clear register to fast IO 4 clear register. This register is right only. These are the memory addresses which you can use for accessing these registers. Default value is again 0 for all these registers. So this register is used to force logic low on any particular port pin of port X. So writing 1 produces lows at that corresponding port pin while writing 0 has no effect on that port pin. Only bits enabled by 0 in mask registers can be altered. So this is one example. In this example p0.5 is forced to logic low. So this is third orbit format. So we are interested in port pin p0.5. We want to force low on this particular port pin. So we will write 1 at this bit position. So let us calculate the hex value for the above combination. So the statement will look like fast IO 0 clear register is equal to 0x00020 or one left shifted by 5 bits. So these lines force logic low on port 0 pin p0.5. One more register fast IO pin value register is used for multipurpose. For example this register provides the current status of each pin of port X. So current status of digital port pins regardless whether that pin is configured for input or output or as a GPIO or an alternate digital function. If you read 0 it indicates that the port pin current status logic low. If you read 1 that indicates that the port pins current status high. Only the bits which are enabled by 0 in fast IO mask register can be read or altered. One more use of this register which bypasses the use of IO set register and IO clear register. The meaning is you can force high and low with the use of this single register. Let us learn this with one example. So let us produce high on port 0 pins p0.0, p0.2, p0.4 and p0.6 and logic low on pins p0.1, p0.3, p0.5 and p0.7. So how to produce logic high and logic lows on these pins? So write 1 on the corresponding bits if you want to produce high and 0 on the corresponding bits where you want to force logic low. So for pins 0, 2, 4 and 6 we want to produce logic high. So we should write 1 in the corresponding bits of pin value register and for the pins 1, 3, 5, 7 we want to produce logic low. So we should write 0 in the corresponding bits. So to produce logic high on any port pin we should write 1 in the corresponding bit of pin value register. If you want to produce logic low on any pin we should write 0 in the pin value register. So in this example we want to force pin 0, 2, 4 and 6 to logic high. So we should write 1 in the corresponding bit fields of pin value register and we want logic low on 1, 3, 5 and 7. So we should write 0 in the corresponding bit fields of pin value register. So after writing we will get hex-5-5 combination for the pin value register. So again we need to apply mass and then we will add this hex-5-5 to the pin value register. So the statement will look like FastIO 0 pin register is equal to FastIO 0 pin ended with this mass or with our 0x-5-5 combination. Or we have two statements. First is the mask statement and second is the o-ring statement. Thank you.