Commits

Ahmad Khayyat committed ecfbdee

Edit exp2

Comments (0)

Files changed (1)

 more extensive APIs for additional peripherals and board features, but are
 usually less generic and vendor-specific.
 
-=== accessing registers under CMSIS
+=== Accessing Registers Using CMSIS
 
-When you use CMSIS, you don't need to know the address of any register. That implies that
-you don't need to use `#define` directive to give names for the registers as in experiment-1. 
-All the definitions are in _lpc17xx.h_ which is included at the beginning of your source file when
-a new CMSIS project is opened.
-
+When you use CMSIS, you don't need to know the address of any
+register. That implies that you don't need to use the `#define`
+directive to name the registers as you did in Experiment 1. All the
+definitions are already in the `lpc17xx.h` file, which is included at
+the beginning of your source file when a new CMSIS project is created.
 
 You need to know two names to access a register:
-. the name of pointer to the structure instance.
-. The element of structure element:
 
-For GPIO, the name of pointer to the structure instance is:
+. The name of the pointer to the structure instance.
+. The name of the field within the structure.
 
-. LPC_GPIO0   for port-0
-. LPC_GPIO1   for port-1
-. LPC_GPIO2   for port-2
-. LPC_GPIO3   for port-3
-. LPC_GPIO4   for port-4
+For GPIO, the names of the pointers to the structure instances are:
 
-You can access different registers for each GPIO.
-The three registers used in experiment-1 are (regardless whether your pin is in port0,1,2,3 or 4):
-. FIODIR
-. FIOSET
-. FIOCLR
+[horizontal]
+`LPC_GPIO0`:: for port 0
+`LPC_GPIO1`:: for port 1
+`LPC_GPIO2`:: for port 2
+`LPC_GPIO3`:: for port 3
+`LPC_GPIO4`:: for port 4
 
+For each port, you can access different registers by accessing the
+corresponding field in that port's structure instance. The three
+registers used in Experiment 1 are:
 
-==== Examples:
+. `FIODIR`
+. `FIOSET`
+. `FIOCLR`
 
-To control the direction of pins in port-2, you should use the following:
+Each of these registers is accessible within the structure instance of
+each port.
 
+.Examples:
+
+- To control the direction of pins in port 2, use the following
+  register:
++
 [code,c]
-
 ---------------
 LPC_GPIO2->FIODIR
--------------
+---------------
 
-
-To set pins in port-1, you should use the following:
-
+- To set pins in port 1, use the following register:
++
 [code,c]
-
 ---------------
 LPC_GPIO1->FIOSET
--------------
+---------------
 
+=== Connecting External LEDs
 
+- What is an LED?
 
-===  Connecting external LEDs
+- How does an LED work?
 
-.What is LED?
-.How it works?
-.What is the  maximum voltage it can tolerate.
-.If the output voltage is higher than the LED max voltage, what you can do?
-.It should be connected to an output GPIO pin.
+- What is the maximum voltage that an LED can tolerate?
 
-==== GPIOs revisited
+- If the output voltage is higher than the LED maximum voltage, what
+  should you do?
 
-GPIO is available in all of the I/O pins. A GPIO is pin that can be used as a digital input or digital output pin. 
-Clearly you need a command  to choose the direction of the pin (whether it is used as input or output).
-In this experiment we will choose the direction to make the required pin GPO (general purpose output).
-In this case (GPO), you need a command  to set this output pin to HIGH (1) and a command to Clear it to LOW (0).
-  
+- An LED should be connected to an output GPIO pin.
+
+==== GPIO, Revisited
+
+The GPIO mode is available in all I/O pins. A GPIO pin is one that can
+be used as a digital input or digital output. Obviously, you need to
+choose the direction of the pin to determine whether it is going to be
+used as input or output. In this experiment, we will choose the
+direction to make the required pin work as GPO (General-Purpose
+Output). In this case (GPO), you need a command to set this output pin
+to HIGH (1), and a command to Clear it to LOW (0).
 
 == Tasks
 
 
 . Choose I/O Pins
 
-. Connect the LEDs using a proper current limiting resistor.
+. Connect the LEDs using a proper current-limiting resistor.
 
 === Software
 
 . Keep both projects selected: `CMSIS_CORE_LPC17xx` and
   `CMSIS_DSPLIB_CM3`, and click _Finish_.
 
-==== open a new project
+==== Open a New Project
 
-==== Write a Program to perform LED scrolling 
+==== Implement LED Scrolling
 
-in the source file of your project write a code to make it looks like that a light is scrolling through your 4 LEDs.
-You can achieve that by turning  LEDs ON sequentially.  
-
+Write a program that makes it look like that a light is scrolling
+through your 4 LEDs. You can achieve that by turning LEDs ON and OFF
+sequentially.