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-1b:start [2017/05/12 18:34] – [3.1. Hardware] Talesa Bleything | learn:courses:microprocessor-io-lab-1b:start [2022/10/04 11:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| - How to write a computer program using the [[http:// | - How to write a computer program using the [[http:// | ||
| - How to launch a [[http:// | - How to launch a [[http:// | ||
| - | - How to configure the PIC32 I/O pins for digital input and output (See [[https:// | + | - How to configure the PIC32 I/O pins for digital input and output (See [[/ |
| Line 30: | Line 30: | ||
| ===== 3. Equipment List ===== | ===== 3. Equipment List ===== | ||
| ==== 3.1. Hardware ==== | ==== 3.1. Hardware ==== | ||
| - | - [[http://store.digilentinc.com/ | + | - [[https://digilent.com/shop/ |
| - | - [[http://store.digilentinc.com/ | + | - [[https://digilent.com/shop/ |
| - Workstation computer running Windows 10 or higher, MAC OS, or Linux | - Workstation computer running Windows 10 or higher, MAC OS, or Linux | ||
| Line 112: | Line 112: | ||
| LATDCLR = BIT_7; // Segment F on | LATDCLR = BIT_7; // Segment F on | ||
| LATDCLR = BIT_13; // Segment G on | LATDCLR = BIT_13; // Segment G on | ||
| - | LATGSET = BIT_14; // Segment DP off | + | LATGSET = BIT_14; // Segment DP off |
| LATBSET = BIT_12; // Display 0 off | LATBSET = BIT_12; // Display 0 off | ||
| LATBSET = BIT_13; // Display 1 off | LATBSET = BIT_13; // Display 1 off | ||
| Line 127: | Line 127: | ||
| ==== 7.5. Persistence: | ==== 7.5. Persistence: | ||
| - | The display in Fig. 8.2 appears to have LED segments in three digits simultaneously displayed. As just discussed, the cathodes of all four of the 7-segment LEDs are connected in parallel and the particular digit is selected by asserting the common anode pin high. In order to make the 4-digit display appear that all four LED digits are simultaneously on, one should make sure each digit is displayed for a minimum of 1 millisecond. Listing 7.2 provides a simple software delay. Since this delay is dependent on the speed of execution, the “ms_cnt” will need to be changed depending on the speed of the core frequency. For the example shown in Listing 7.2, the ms_cnt value of 1000 is set to generate a one ms delay when the core frequency is set to 80 MHz. | + | The display in Fig. 8.2 appears to have LED segments in three digits simultaneously displayed. As just discussed, the cathodes of all four of the 7-segment LEDs are connected in parallel and the particular digit is selected by asserting the common anode pin high. In order to make the 4-digit display appear that all four LED digits are simultaneously on, one should make sure each digit is displayed for a minimum of 1 millisecond. Listing 7.2 provides a simple software delay. Since this delay is dependent on the speed of execution, the “ms_cnt” will need to be changed depending on the speed of the core frequency. For the example shown in Listing 7.2, the ms_cnt value of 10000 is set to generate a one ms delay when the core frequency is set to 80 MHz. |
| ---- | ---- | ||
| Line 135: | Line 135: | ||
| void sw_delay(int ms) | void sw_delay(int ms) | ||
| { | { | ||
| - | unsigned int ms_cnt; // 1 ms counter | + | unsigned int ms_cnt; |
| - | while(ms--) // ms loop counter | + | while(ms--) |
| { | { | ||
| - | ms_cnt = 10000; // Reset ms counter | + | ms_cnt = 10000; |
| - | while(--ms_cnt); | + | while(--ms_cnt); |
| } | } | ||
| } | } | ||
| Line 244: | Line 244: | ||
| - Consider the case when pin RF0 is programmed to be an input and the signal TRIG_1 is a digital output signal from an external device that is either 0 or 3.3V. What effect will pressing the BTNC button have on the processor RF0 pin when TRIG_1 is low and when it is high? | - Consider the case when pin RF0 is programmed to be an input and the signal TRIG_1 is a digital output signal from an external device that is either 0 or 3.3V. What effect will pressing the BTNC button have on the processor RF0 pin when TRIG_1 is low and when it is high? | ||
| - Consider the case when pin RF0 is programmed to be an output and the signal TRIG_1 is a digital input signal to an external device. What effect will pressing the BTNC button have on the TRIG_1 signal when the RF0 output is low and when it is high? | - Consider the case when pin RF0 is programmed to be an output and the signal TRIG_1 is a digital input signal to an external device. What effect will pressing the BTNC button have on the TRIG_1 signal when the RF0 output is low and when it is high? | ||
| - | - Measure the loop execution time by toggling Pmod connector JA pin 1 at the start of the loop execution using the instruction | + | - Measure the loop execution time by toggling Pmod connector JA pin 1 at the start of the loop execution using the instruction |
| - What is this time? | - What is this time? | ||
| - Is this time expected? | - Is this time expected? | ||

