Actually no need to build a USB stack if one is willing to use JALv2, which has a complete USB stack, including serial and HID, in its libraries. Check out this sample piece of code to set up an HID keyboard: http://jallib.googlecode.com/svn/trunk/doc/html/usb_keyboard.html ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include usb_keyboard ... usb_keyboard_init() ... ;-- wait till USB becomes available while ( !usb_is_configured() ) loop end loop ... ;-- main loop var byte ch forever loop ; -- call the flush routine on a regular base in the main loop ; -- in order to keep the USB communicaiton alive usb_keyboard_flush() ..... if ( usb_is_configured() ) if ( pin_x ) ush_keyboard_send_key( 0x00, USB_KEYBOARD_KEY_A ) else ush_keyboard_send_key( 0x00, USB_KEYBOARD_KEY_NONE ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Doesn't get much easier than that. BAJ On Mon, Nov 21, 2011 at 02:04:20PM -0800, Christopher Head wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: RIPEMD160 >=20 > On Sun, 20 Nov 2011 10:17:41 -0800 > "Harold Hallikainen" wrote: >=20 > > There are couple of ways that come to mind. Probably the simplest is > > to use a USB to UART bridge like the Silicon Labs CP2102 and similar > > chips from Future Technology Devices. The other approach is to use a > > PIC with USB hardware on chip. This requires use of the USB firmware > > provided by Microchip. Microhip provides some sample code. >=20 > To be technically correct, it doesn't "require the use of the USB > firmware provided by Microchip". There's nothing stopping you from > writing your own, and the USB engine is fully documented in the > datasheets, at least for the 18Fs. I believe a few people on this list > have constructed their own USB stacks. >=20 > Chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.17 (GNU/Linux) >=20 > iEYEAREDAAYFAk7KyucACgkQXUF6hOTGP7dpkgCgiUM2xDuBPQQt9hoSwYI1saOB > +7AAnRSh+fItisKXmCOh9XZuQp7+AfFt > =3DIT5w > -----END PGP SIGNATURE----- >=20 > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Byron A. Jeff Department Chair: IT/CS/CNET College of Information and Mathematical Sciences Clayton State University http://cims.clayton.edu/bjeff --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .