How To Build A Usb Device With Pic 18f4550 or 18f2550 (And The Microchip CDC Firmware) PDF
How To Build A Usb Device With Pic 18f4550 or 18f2550 (And The Microchip CDC Firmware) PDF
How To Build A Usb Device With Pic 18f4550 or 18f2550 (And The Microchip CDC Firmware) PDF
Electronicfr in english
Linux on Fujitsu stylistic 1200
How-to build a webserver for 30Euros with
Part 1: How to
USB and PIC tutorial
ENC28J60 build a USB
A little autonomous robot
- Part 1 - How to build a USB device
A new autonomous robot project (V2) with a PIC 18F4550 or 18F2550 device with a
How-to build a usb device a with 18F4550 - Part 2 - Application: How to build
or 18F2550 a USB thermometer PIC 18F4550 or
. New: Discussion forum 18F2550
Electronicfr en francais
Fabriquer un serveur web avec un circuit Overview
ENC28J60
PIC 18F4550 and 18F2550 are powerful microcontrollers including a full-speed USB V2.0 compliant interface.
Un petit robot autonome picbasic 3B
Un nouveau robot autonome PIC With these MCU it's very easy for the hobbyist to design USB devices with very few components.
Construire un priphrique USB avec un PIC
In this page, I will describe how to use the CDC firmware from Microchip. It permits to emulate a serial port
18F4550 ou 18F2550
with a PC running Windows or Linux. It's also very easy to build HID devices.
. Nouveau: Forum de discussion
The 18F4550 experimentation board
Search:
www.electronicfr.
Web com
Search
www.policefr.com
The following schematic is very simple, only few components are needed. It's a self powered USB device.
Please note I'm using the Olimex tiny-ICSD programmer, if you want to use another PIC ICSP programmer,
you should remove D1 and D2 and change the connector
(You can click on the picture to get an high resolution picture)
Please note C5 is 470nF (the datasheet recommend 220nF but more is better) and should be low ESR (for
example a multi-layer ceramic). Don't forget the 100nF decoupling caps.
You can look at the wire's colour of your USB cable: Black=GND, Red=+5V, Green=Data+, White=Data-
The software
You can download MCHPFSUSB_Setup on the Microchip website. It's a windows .exe :(. The firmware we
will use is written in C (for the C18 Microchip compiler). This code is (royaltyes) free, but it's not a free
software, so it's not possible to redistribute modified source code
You should comment the following lines in usbcfg.h for a self powered usb device:
#define USE_SELF_POWER_SENSE_IO
#define USE_USB_BUS_SENSE_IO
You can put your own code on user.c. For example, look at Exercise_Example() in user.c.
Useful functions are getsUSBUSART() (get data) and putrsUSBUSART() (put data other the serial port)
They are some examples in the exercise directory. For example, the following program (to put in user.c)
toggle the LED number 4 when you press the key "1" in the terminal
They are some examples in the exercice directory. For example, the following program (to put in user.c)
toggle the LED number 4 when you press the key "1" in the terminal
void Exercise_03(void){
if(getsUSBUSART(input_buffer,1))
{
if(input_buffer[0] == '1')
mLED_4_Toggle();
}
Under windows, you must install the provided driver and you can use the hyperterminal utility (19200bd
with a 20MHz crystal). Under linux, check the cdc-acm module, a new device /dev/ttyACM0 should appear.
If you don't want to use the bootloader, you must remove the vector remapping section in main.c and
change the linker script (look at important.readme.txt in the sources directory)
Next part -> Application: How to build a USB thermometer
PIC and USB
- French version/Version franaise
- Forum: Microcontrollers and usb
Electronicfr in english
Linux on Fujitsu stylistic 1200 USB and PIC tutorial
How-to build a webserver for 30Euros with
Part 2: How to build a USB
- Part 1 - How to build a USB device
ENC28J60
with a PIC 18F4550 or 18F2550
thermometer with PIC
A little autonomous robot
- Part 2 - Application: How to build a
A new autonomous robot project (V2) USB thermometer 18F4550 or 18F2550
How-to build an usb device with 18F4550 or
18F2550
. New: Discussion forum Sensor and schematic
We will add a temperature sensor to the circuit described in the first part of this tutorial. You can use the very usual LM35 circuit
Electronicfr en francais (Datasheet), or many others circuits like MCP9701, TC1047...
Fabriquer un serveur web avec un circuit
The following schematic show how to plug the sensor on our USB experimentation board:
ENC28J60
Un petit robot autonome picbasic 3B
Un nouveau robot autonome PIC
Construire un priphrique USB avec un PIC
18F4550 ou 18F2550
. Nouveau: Forum de discussion
Search:
www.electronicfr.
Web com
Search
www.policefr.com
The firmware
We will add some code for analog to digital convertion and temperature calculation in the file user.x
void Exercise_Example(void)
{
int temp;
// [...]
else if(start_up_state == 3)
{
if(mUSBUSARTIsTxTrfReady())
{
//A0 set in input
TRISAbits.TRISA0 = 1;
}//end Exercise_Example
The value in Celsius degree will be sent threw the USB bus when the button on RB4 will be pressed.
Under windows, you can use the hyperterminal utility (19200bd with a 20MHz cristal) to see the value. Under linux you can use cat /dev/
ttyACM0 .
Disclaimer
ANY CONTENT ON THIS WEBSITE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Next
Soon, you will find a schematic for a USB to serial (RS232) converter.