Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Another try at Microchip's USB CDC- Basic Demo

Status
Not open for further replies.

SilverWingz

New Member
Brushing away the cobweb's from this old attempt of mine,i gave it another go.
And finally managed to get the textbook Program running.

It beaved as described:identified itself as a virtual serial port,accepted characters from my hyperterminal and returned the next character.

What i want is:HELP UNDERSTANDING THE CODE so that i can modify it to meet my own needs.

Here is the little modifications i did:
1. changed the xtal to 20M from the default.
2. commented away the usb status led functions.
3. then,in the ProcessIO function,i added my own switch case-
if 'q' is pressed,generate a pwm.

unfortunately,whatever that is being generated on the O/P end is not a pwm signal.
the rest of the usb functionalities work as usual

can any1 familiar with the USB CDC code provided by microchip help me understand it,so i have understanding enough to modify it for myself?

The Project is attatched:


Thanks,
Gigil

PS:i'm working on a PIC18F4550,20MHz, rigged up the ckt on a breadboard to something resembling the PICDEM FSUSB.Just the bare necessities
 

Attachments

  • PICDEM FSUSB.rar
    89.2 KB · Views: 187
what i'm actually planning to do is a usb based actuator cum feedback device:
say,switch from quad encoder feedback monitoring to adc monitoring to stepper motor drive generator to pwm generator,according to key presses on the pc end.
im not much familiar with cse jargon much,previously i did it using serial port.this cdc virtual com port sounded like something i'd be comfortable with,so i just went for it.dont understand the intricacies of the protocol much,which is why i am usnig the stack provided by microchip.
connecting to the virtual com using hyperterminal or matlab was sumthing i understood.
wouldnt know how to go about it the 'HID' way
 
That's fine... Normally interfacing uses HID ( joysticks, mice etc...) The CDC is just a virtual serial port in the USB wrapper.... You just need to treat it just the same..

I downloaded com0com virtual com software... It enumerates so I can sim in ISIS and feed the sim with VB6....

I don't even use the microchip USB stack... I just buy an ft232r breakout board... And just use serial RS232.
 
Status
Not open for further replies.

Latest threads

Back
Top