Introduction
Port B of PIC18F1220 has an internal programmable weak pull up resistors. However it’s not individually select-able. These resistors have only one shared global switch locates in OPTION Register.
Pin diagram of PIC18F1220 |
Additionally, this port is multiplexed with ADC input. To configure it to a solely digital I/O, the user must check the ADCON1 register.
Interfacing and Programming
Using a simulator to simulate the circuit, the overall prototyping is fast and effective. It reduces cost, time and physical hardware defect.
Hardware Interfacing
PIC18F1220 microcontroller accept digital input on lower nibble of Port B. Its higher nibble connects to LED representing the digital input on lower nibble.
Schematic Diagram |
Programming
At setting up section of C main program, programmer need to clear port I/O, disabling analog input function, setting up port direction, and turning on Port B weak pull up resistors.
PIC18F1220 configuration bits setting is very long that programmer doesn’t want to put inside C main file.
Click here to download this programming example.
No comments:
Post a Comment