The general purpose I/O ports allow the dsPIC30F to monitor and control other devices. Most I/O pins are multiplexed with alternate function(s). The multiplexing will depend on the peripheral features on the device variant. In general, when a peripheral is functioning, that pin may not be used as a general purpose I/O pin. All port pins have three registers directly associated with the operation of the port pin:
- TRISx-Data Direction register
- LATx I/O Port register
- PORTx I/O Latch register
In this example RB1 pin is used as digital output pin and RD0 is used as digital input pin. Pin RDO is connected with taster as on picture. RB1 pin can be used as general purpose output pin to drive LED diode directly or as TTL level signal output. When we push button, we change state of diode. Complete source code programmed in dsPic C30 compiler with MPLAB project files is provided and every line has comments with detailed explanation.
In this example RB4, RB5 and RD0 pins are used as digital output pins. These pins can be used as general purpose output pins (GPIO pins) to drive LED diode directly or as TTL level signal output. Complete source code programmed in dsPic C30 compiler with MPLAB project files is provided and every line has comments with detailed explanation.
- Internal ADC
Tutorials of how to drive input/output pins of dsPIC Microchip microcontroller are placed here. GPIO pin you need for every microcontroller for interaction with outside world. Detailed description of register usage with example code writen for C30 compiler is placed here for you to download, test and learn thru examples.
- dsPic SPI