Changeset 89e680d in avrstuff
- Timestamp:
- Jan 16, 2012, 9:55:19 PM (12 years ago)
- Branches:
- main
- Children:
- ce05fdc
- Parents:
- 3c17057
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
V-USB_Dev/firmwares/CrO2/main.c
r3c17057 r89e680d 34 34 bit = 1; 35 35 bitpos = 7; 36 readPos = 0;36 readPos = 13; 37 37 38 38 // Generate sync header (this never changes) … … 50 50 // CTC mode with OCR1A as MAXregister 51 51 TCCR1B = (1<<WGM12); 52 OCR1A = 13063; // 800us bit clock 53 OCR1B = 6532; // Half-clock for 1 bits 52 // "Official" values : 13063/6532 (closest to MO5 specified rate) 53 // 9580 NOK 54 // 9582 OK 55 OCR1A = 9582; // 800us bit clock 56 OCR1B = 4750; // Half-clock for 1 bits 54 57 TIMSK = (1 << OCIE1B) | (1 << OCIE1A); // interrupts on both timer matches. 55 58 TCCR1A |= (bit << FOC1A); // Force toggle of A (make sure output is a logic 1 to allow MO5 to detect tapedrive) … … 76 79 usbRequest_t *rq = (void *)data; 77 80 78 usbMsgPtr = ioblock;79 81 switch(rq->bRequest) 80 82 { … … 86 88 case 1: 87 89 { /* RECEIVE/POLL DATA (TAPE > USB) */ 90 usbMsgPtr = ioblock; 88 91 return 254; 89 92 } … … 107 110 return USB_NO_MSG; // Call usbFunctionWrite to send the data 108 111 } 112 } 113 case 3: 114 { 115 // Read status 116 status = PINC; 117 usbMsgPtr = &status; 118 return 1; 109 119 } 110 120 } … … 153 163 // Stop generating (and interrupts) 154 164 TCCR1B &= ~(1<<CS10); 155 readPos = 0;165 readPos = 14; 156 166 157 167 // make sure output is high step 2 : force a match.
Note:
See TracChangeset
for help on using the changeset viewer.