Project Report: Micro Computer System
Project Report: Micro Computer System
Project Report: Micro Computer System
PROJECT TITLE
SUBMITTED TO:
GROUP MEMBERS:
SECTION:
SUBMISSION DATE:
31 MAY 2011
Microchip Technology’s PIC microcontrollers are popular due to their low cost, wide
availability, large selection, good performance, and low power consumption.
The PIC18F4550 contains a USB controller that can function at low and full speeds. Microchip
offers other variants with different combinations of features. The PIC18F4550 is a member of
Microchip’s high-performance, low-cost, 8-bit PIC18 series. Firmware resides in 32 KB of
flash memory. The chip has 2KB of RAM and 256 bytes of EEPROM. A boot loader routine
can upgrade firmware via the USB port.
The chip has 34 I/O pins that include a 10-bit analog-to-digital converter, a
USART, a synchronous serial port that can be configured to use I2C or SPI,
enhanced PWM capabilities, and two analog comparators. The USB module and CPU can use
separate clock sources, enabling the CPU to use a slower, power-saving clock.
The USB controller supports all four transfer types and up to 30 endpoint addresses plus the
default endpoint. The endpoints share 1 KB of buffer memory, and transfers can use double
buffering. For isochronous transfers, USB data can transfer directly to and from a streaming
parallel port. For each enabled endpoint address, the firmware must reserve memory for abuffer
and a buffer descriptor. The buffer descriptor consists of four registers. Firmware can access the
register’s contents as a structure, a single 32-bit value, or a byte array.
The status register contains status information and the two highest bits of the endpoint’s byte
count. The byte-count register plus the two bits in the status register contain the number of
bytes sent or ready to send in an IN transaction or the number of bytes expected or received in
an OUT transaction. The address-low and address-high registers contain the starting address for
the endpoint’s buffer in RAM. The microcontroller’s CPU and the USB SIE share access to the
buffers and buffer descriptors.
Clock diagram
INTERNAL OSCILLATOR BLOCK
The PIC18F4550 devices include an internal oscillator block which generates two different
clock signals; either can be used as the microcontroller’s clock source. If the USB peripheral is
not used, the internal oscillator may eliminate the need for external oscillator circuits on the
OSC1 and/or OSC2 pins.
When the PIC18F4550 is used for USB connectivity, it must have either a 6 MHz or 48 MHz
clock for USB operation, depending on whether Low-Speed or Full-Speed mode is being used.
This may require some forethought in selecting an oscillator frequency and programming the
device. The full range of possible oscillator configurations compatible with USB operation.
The USB module, in either mode, can run asynchronously with respect to the microcontroller
core and other peripherals. This means that applications can use the primary oscillator for the
USB clock while the microcontroller runs from a separate clock source at a lower speed. If it is
necessary to run the entire application from only one clock source, full-speed operation
provides a greater selection of microcontroller clock frequencies.
COMPONENTS
PIC18F4550
MXX 232
Universal Serial Bus (USB)
Capacitors (10uF)
Crystal Oscillator
UART
Resistors
Wires
#include <18F4550.h>
#fuses
HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL1,CPUDIV1,VREGEN
#use delay(clock=48000000)
#include <usb_cdc.h>
void usb_debug_task(void)
usb_attached();
usb_enumerated();
usb_cdc_connected();
}
void main(void)
char c;
usb_init_cs();
while (TRUE)
usb_task();
usb_debug_task();
if (kbhit())
c=getc();
else {usb_cdc_putc(c);}
if (usb_cdc_kbhit())
{
c=usb_cdc_getc();
else {putc(c);}
Circuit Diagram