| Electronic Components Datasheet Search |
|
USB245 Datasheet(PDF) 4 Page - List of Unclassifed Manufacturers |
|
|
|||||||||||||||||||||||||||||
USB245 Datasheet(HTML) 4 Page - List of Unclassifed Manufacturers |
|
4 / 6 page ![]() The Following is a sample ‘C’ that reads a character from the USB and writes it back out. #include <c:\sxc\include\dev\SX28AC.H> #include <c:\sxc\include\port.h> #define TXEn PORTA.3 // INPUT #define WRITE PORTA.2 // OUTPUT #define READn PORTA.1 // OUTPUT #define RXFn PORTA.0 // INPUT #pragma FUSE = FOSC_HS2 & TURBO & WDTD #pragma FUSEX = EXTEND unsigned char byte; /*--------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------*/ void send_byte() { DDR(PORTC,0x00); // make PORTC output WRITE=1; NOP(); PORTC=byte; NOP(); WRITE=0; DDR(PORTC,0xFF); // now make PORTC input } /*--------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------*/ void read_byte() { READn=0; NOP(); byte=PORTC; NOP(); READn=1; } /*--------------------------------------------------------------------------*/ /* */ /*--------------------------------------------------------------------------*/ void main() { OPTION(RTW|RTE_D|PSA); // start with RTC int disabled DDR(PORTC,0xFF); // USB Data Port DDR(PORTB,0xFF); // all inputs DDR(PORTA,0xF9); // USB Status lines WRITE=0; // Initialize control READn=1; // Outputs Here while (1) // Loop forever {if (RXFn == 0) // Is there a character available {read_byte(); // Yes, so get it send_byte(); // and send it back out } } } Setup and running. Place the USB device in an empty breadboard, noting proper pin orientation. If you are using the USB adapter cable, while it is NOT plugged into a master or PC, plug the proper end into the breadboard next to the USB245 so that the pin with the Red wire connects to USB245 pin 22, and the pin with the black wire connects to pin 19. Place a jumper wire between pins 22 & 23 of the USB245 on the breadboard. At this point only the top-right 6 pins of the USB245 will be attached. With nothing else attached to the module, except as noted above, now plug the other end of the cable into the PC. It should recognize a new USB device a start searching for drivers. When it |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |