Книга: Advanced PIC Microcontroller Projects in C
PROJECT 8.1 — USB-Based Microcontroller Output Port
This project describes the design of a USB-based microcontroller output port. A PIC18F4550 microcontroller is interfaced to a PC through a USB cable. A Visual Basic program runs on the PC and sends commands to the microcontroller through the USB bus, asking the microcontroller to set/reset the I/O bits of its PORTB.
The block diagram of the project is shown in Figure 8.10. The circuit diagram is given in Figure 8.11. The USB lines of the PIC18F4550 microcontroller are connected to a USB connector. The microcontroller is powered from the USB line (i.e., no external power supply is required). This makes the design of USB-based products relatively cheap and very attractive in applications where the total power consumption is below 100mA. The microcontroller is operated from an 8MHz crystal.
Figure 8.10: Block diagram of the project
Figure 8.11: Circuit diagram of the project
The PORTB pins of the microcontroller are connected to LEDs so we can see the state changes as commands are sent from the PC. This makes testing the project very easy. Note that a capacitor (about 200nF) should be connected between the VUSB pin (pin 18) of the microcontroller and the ground for stability.
The project software consists of two parts: the PC software, and the microcontroller software. Both are described in this section.
- CHAPTER 8 Advanced PIC18 Projects — USB Bus Projects
- 1.3 Microcontroller Features
- 1.4 Microcontroller Architectures
- 8.2 USB States
- 8.6 mikroC Language USB Bus Library Functions
- PROJECT 8.2 — USB-Based Microcontroller Input
- PROJECT 8.3 — USB-Based Ambient Pressure Display on the PC
- 7.2.9. Цепочка OUTPUT
- Introduction to Microprocessors and Microcontrollers
- Chapter 16. Commercial products based on Linux, iptables and netfilter
- Project PDL
- Multiport match