Abstract

This chapter focuses on the design of simple PIC18 microcontroller-based projects. In one of the projects, eight LEDs are connected to PORTC of a PIC18F452-type microcontroller, and the microcontroller is operated from a 4MHz resonator. When power is applied to the microcontroller, the LEDs turn ON alternately in an anticlockwise manner where only one LED is ON at any time. LEDs are connected to PORTC in current sourcing mode with eight 290-Ω resistors. A 4MHz resonator is connected between the OSC1 and OSC2 pins. Also, an external reset push button is connected to the MCLR input to reset the microcontroller when required. Another is a simple dice project based on LEDs, a push-button switch, and a PIC18F452 microcontroller operating with a 4MHz resonator. Seven LEDs representing the faces of a dice are connected to PORTC of a PIC18F452 microcontroller in current sourcing mode using 290-ohm current limiting resistors. A push-button switch is connected to bit 0 of PORTB (RB0) using a pull-up resistor. At the beginning of the program PORTC, pins are configured as outputs and bit 0 of PORTB is configured as input. The state of the push-button switch is checked, and, when the switch is pressed (switch output at logic 0), the current number is sent to the LEDs.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.