Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| learn:courses:microprocessor-io-lab-1a:start [2017/03/15 17:22] – [8.1. Requirements] Martha | learn:courses:microprocessor-io-lab-1a:start [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Lab 1a: Microprocessor IO ====== | ====== Lab 1a: Microprocessor IO ====== | ||
| + | [[{}/ | ||
| == Download This Document == | == Download This Document == | ||
| - | * {{ : | + | {{ : |
| Line 21: | Line 22: | ||
| ===== 3. Equipment List ===== | ===== 3. Equipment List ===== | ||
| ==== 3.1. Hardware ==== | ==== 3.1. Hardware ==== | ||
| - | | + | |
| - | | + | |
| - | | + | |
| In addition, we suggest the following instruments: | In addition, we suggest the following instruments: | ||
| - | | + | |
| ==== 3.2. Software: ==== | ==== 3.2. Software: ==== | ||
| The following programs must be installed on your development work station: | The following programs must be installed on your development work station: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| Line 50: | Line 51: | ||
| ===== 6. Problem Statement ===== | ===== 6. Problem Statement ===== | ||
| - | In this lab, you will be using specified switches to turn specified | + | In this lab, you will turn the RED, BLUE, and GREEN colors of the tri-color LED8 either on or off using SW0, SW1, and SW2, respectively. |
| ---- | ---- | ||
| Line 56: | Line 57: | ||
| ===== 7. Background Information ===== | ===== 7. Background Information ===== | ||
| ==== 7.1. Control Registers ==== | ==== 7.1. Control Registers ==== | ||
| - | In this lab, we will make use of the TRISx, LATx, and PORTx control registers. TRISx registers simply control the data direction flow through port I/O pins, e.g., whether a PORTx I/O pin is an input or an output. If the data direction bit is a “1”, then the corresponding PORTx I/O pin is an input, and vice versa. | + | In this lab, we will make use of the TRISx, LATx, and PORTx control registers. TRISx registers simply control the data direction flow through port I/O pins, e.g., whether a PORTx I/O pin is an input or an output. If the data direction bit is a “1,” then the corresponding PORTx I/O pin is an input, and vice versa. |
| - | LATx registers (PORTx data latch) hold data written to port I/O pins. A write to a LATx register latches data to the corresponding port I/O pins and those I/O port pins configured as outputs are updated. A read from a LATx resister reads the data held in the PORTx data latch, not directly from the port I/O pins (this distinction will come into play in [[https:// | + | LATx registers (PORTx data latch) hold data written to port I/O pins. A write to a LATx register latches data to the corresponding port I/O pins and those I/O port pins configured as outputs are updated. A read from a LATx resister reads the data held in the PORTx data latch, not directly from the port I/O pins (this distinction will come into play in [[/ |
| - | PORTx registers are the registers that allow I/O pins to be accessed. A write to a PORTx register writes to the corresponding LATx register (PORTx data latch) and those I/O port pins configured as outputs are updated. This is effectively the same as writing to a LATx register. A read from a PORTx register reads the synchronized signal applied to the post I/O pins. | + | PORTx registers are the registers that allow I/O pins to be accessed. A write to a PORTx register writes to the corresponding LATx register (PORTx data latch) and those I/O port pins configured as outputs are updated. This is effectively the same as writing to a LATx register. A read from a PORTx register reads the synchronized signal applied to the port I/O pins. |
| ==== 7.2. Configuring the PIC32 for Digital Inputs ==== | ==== 7.2. Configuring the PIC32 for Digital Inputs ==== | ||
| Line 67: | Line 68: | ||
| ---- | ---- | ||
| - | ==== Listing 7.1. Instructions for Setting Analog Inputs to be Digital Inputs | + | ==== Listing 7.1. Instructions for Setting Analog Inputs to be Digital Inputs |
| < | < | ||
| TRISBbits.TRISB9 | TRISBbits.TRISB9 | ||
| Line 107: | Line 108: | ||
| ===== 8. Lab 1a ===== | ===== 8. Lab 1a ===== | ||
| ==== 8.1. Requirements ==== | ==== 8.1. Requirements ==== | ||
| - | This exercise uses the Basys MX3 switches SW0 through SW2 to control the red, blue, and green LEDs on the tri-colored LED labeled LED8 according to the following rules (referring | + | This exercise uses the Basys MX3 switches SW0 through SW2 to control the red, blue, and green LEDs on the tri-colored LED labeled LED8 according to the following rules (refer to the schematic diagrams in Appendix A of this lab for additional details): |
| - SW0 is to turn the RED color of LED8 on or off. | - SW0 is to turn the RED color of LED8 on or off. | ||
| - SW1 is to turn the BLUE color of LED8 on or off. | - SW1 is to turn the BLUE color of LED8 on or off. | ||
| Line 168: | Line 169: | ||
| ====== Appendix A: Schematic Drawings ====== | ====== Appendix A: Schematic Drawings ====== | ||
| - | {{ : | + | {{ : |
| //Figure A.1. Slide switch schematic diagram.// | //Figure A.1. Slide switch schematic diagram.// | ||
| - | {{ : | + | {{ : |
| //Figure A.2. Schematic of PIC32 interconnection with the Tri-color LED.// | //Figure A.2. Schematic of PIC32 interconnection with the Tri-color LED.// | ||
| - | {{ : | + | {{ : |
| //Figure A.3. Basys MX3 LEDs.// | //Figure A.3. Basys MX3 LEDs.// | ||
| Line 192: | Line 193: | ||
| - The run section must contain an infinite software loop that, under no condition, must ever end. Typically this infinite loop is written as for(;;){ … } or while(1){ …}. The embedded application executes from the infinite loop or from interrupts that preempt this loop. | - The run section must contain an infinite software loop that, under no condition, must ever end. Typically this infinite loop is written as for(;;){ … } or while(1){ …}. The embedded application executes from the infinite loop or from interrupts that preempt this loop. | ||
| + | ---- | ||
| + | |||
| + | [[{}/ | ||
| + | [[{}/ | ||

