Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
learn:courses:microprocessor-io-unit-1:start [2017/05/26 13:17] – [Listing D.2. Alternate Basic IO Program] brandon marcumlearn:courses:microprocessor-io-unit-1:start [2021/10/07 13:45] Arthur Brown
Line 2: Line 2:
 [[{}/learn/courses/start|Back to Course List]] [[{}/learn/courses/start|Back to Course List]]
 ==Unit 1 Labs== ==Unit 1 Labs==
-  * [[https://reference.digilentinc.com/learn/courses/microprocessor-io-lab-1a/start|Lab 1a]] +  * [[/learn/courses/microprocessor-io-lab-1a/start|Lab 1a]] 
-  * [[https://reference.digilentinc.com/learn/courses/microprocessor-io-lab-1b/start|Lab 1b]]+  * [[/learn/courses/microprocessor-io-lab-1b/start|Lab 1b]]
  
  
Line 35: Line 35:
 ===== 4. Equipment List ===== ===== 4. Equipment List =====
 ==== 4.1. Hardware ==== ==== 4.1. Hardware ====
-  - [[http://store.digilentinc.com/basys-mx3-pic32mx-trainer-board-recommended-for-embedded-systems-courses/|Basys MX3 trainer board]]+  - [[microprocessor/basys-mx3/start|Basys MX3 trainer board]]
   - [[http://store.digilentinc.com/usb-a-to-micro-b-cable/|Micro USB cable]]   - [[http://store.digilentinc.com/usb-a-to-micro-b-cable/|Micro USB cable]]
   - Workstation computer running Windows 10 or higher, MAC OS, or Linux   - Workstation computer running Windows 10 or higher, MAC OS, or Linux
Line 126: Line 126:
 //Figure 8.1. Integrated Development Hardware Diagram.// //Figure 8.1. Integrated Development Hardware Diagram.//
  
-The diagram in Fig. 8.1 shows the Basys MX3 unit. The Basys MX3 has a built-in programmer/debugger that allows a direct connection from the development workstation computer to the Basys MX3 board. If the programmer/debugger is not built into the hardware platform, a separate programmer is required, such as the [[http://store.digilentinc.com/pickit-3-in-circuit-debugger/|PICkit 3]] or a [[http://store.digilentinc.com/chipkit-pgm-programmer-debugger-for-use-with-digilent-chipkit-platforms/|chipKIT Programmer]].  +The diagram in Fig. 8.1 shows the Basys MX3 unit. The Basys MX3 has a built-in programmer/debugger that allows a direct connection from the development workstation computer to the Basys MX3 board. If the programmer/debugger is not built into the hardware platform, a separate programmer is required, such as the PICkit 3 or a chipKIT Programmer.  
  
 ==== 8.2. General Notes of Interest ==== ==== 8.2. General Notes of Interest ====
Line 138: Line 138:
     #define _SUPPRESS_PLIB_WARNING     #define _SUPPRESS_PLIB_WARNING
 #endif #endif
-    #ifndef _DISABLE_OPENADC10_CONFIGPORT_WARNING + 
-        #define  _DISABLE_OPENADC10_CONFIGPORT_WARNING +#ifndef _DISABLE_OPENADC10_CONFIGPORT_WARNING 
-    #endif+    #define  _DISABLE_OPENADC10_CONFIGPORT_WARNING 
 +#endif
 </code> </code>
 <html> <html>
Line 529: Line 530:
  
   @File Name   @File Name
-   PICmx370.c+   hardware.c
  
  @Summary  @Summary
Line 548: Line 549:
  
 #include "hardware.h" #include "hardware.h"
-#include "switches.h" 
 #include <plib.h> #include <plib.h>
  
Line 595: Line 595:
        
    Set_All_LEDs_Output(); /* Configure all Basys MX3 LED0 – LED7 as outputs */    Set_All_LEDs_Output(); /* Configure all Basys MX3 LED0 – LED7 as outputs */
-   Set_All_LEDs_Off(); /* Set all Basys MX3 LED0 – LED7 off */+   Set_All_LEDs_Off();         /* Set all Basys MX3 LED0 – LED7 off */
    Set_All_Switches_Input(); /* Configure all Basys MX3 slide switches as inputs */    Set_All_Switches_Input(); /* Configure all Basys MX3 slide switches as inputs */
-   Set_All_PBs_Input(); /* Configure all Basys MX3 push buttons as inputs */+   Set_All_PBs_Input();         /* Configure all Basys MX3 push buttons as inputs */
        
 } /* End of hardware_setup */ } /* End of hardware_setup */
Line 657: Line 657:
 { {
 // Initialization // Initialization
-    ANSELDbits.ANSD1 = 0;     // RD1 set to digital I/O +    ANSELDbits.ANSD1 = 0;             // RD1 set to digital I/O 
-    TRISDbits.TRISD1 = 0;     // RD1 set to output  +    TRISDbits.TRISD1 = 0;             // RD1 set to output  
-    TRISDbits.TRISD0 = 1;     // RD2 set to input +    TRISDbits.TRISD0 = 1;             // RD0 set to input 
  
 // loop // loop
Line 665: Line 665:
     {     {
         LATDbits.LATD1 = PORTDbits.RD0; //Copy state of RD0 to RD1         LATDbits.LATD1 = PORTDbits.RD0; //Copy state of RD0 to RD1
-    {+    }
 } }
 </code> </code>
Line 686: Line 686:
         else         else
       LATDCLR = 0x02;         // Set RD1 pin low       LATDCLR = 0x02;         // Set RD1 pin low
-    {+    }
 } }
 </code> </code>
Line 718: Line 718:
 | 84       | RD7   | RPD7/PMD15/RD7                         | CF            | "                        | | 84       | RD7   | RPD7/PMD15/RD7                         | CF            | "                        |
 | 80       | RD13  | RPD13/RD13                             | CG            | "                        | | 80       | RD13  | RPD13/RD13                             | CG            | "                        |
-| 95       RD14  | TRD2/RD14                              | CP            | "                        |+| 95       RG14  | TRD2/RG14                              | CP            | "                        |
 | 93       | RE0   | PMD0/RE0                               | DB0           | Character LCD data       | | 93       | RE0   | PMD0/RE0                               | DB0           | Character LCD data       |
 | 94       | RE1   | PMD1/RE1                               | DB1           | "                        | | 94       | RE1   | PMD1/RE1                               | DB1           | "                        |