PIC16C745/P Microchip Technology, PIC16C745/P Datasheet - Page 73
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC16C745/P
Manufacturer Part Number
PIC16C745/P
Description
8-Bit CMOS Microcontrollers with USB
Manufacturer
Microchip Technology
Datasheet
1.PIC16C745P.pdf
(158 pages)
- Current page: 73 of 158
- Download datasheet (3Mb)
SET_CONFIGURATION command. Once the device
is configured, the application can communicate with
the host using the GetUSB and PutUSB calls.
The USB peripheral detects several different errors
and handles most internally. The USB_ERR interrupt
notifies the microcontroller that an error has occurred.
No action is required by the device when an error
occurs. Instead the errors are simply acknowledged
and counted.
device off the bus if there are too many errors. If this
behavior is desired it must be implemented in the
application.
The Activity interrupt is left disabled until the USB
peripheral detects no bus activity for 3 mS. Then it
suspends the USB peripheral and enables the activity
interrupt. The activity interrupt then reactivates the
USB peripheral when bus activity resumes so process-
ing may continue.
; ******************************************************************
; Demo program that initializes the USB peripheral, allows the Host
;
; ******************************************************************
main
idleloop
CheckEP1
PutBuffer
1999 Microchip Technology Inc.
to Enumerate, then copies buffers from EP1OUT to EP1IN.
call
ConfiguredUSB
call
bcf
movlw
movwf
movlw
call
btfss
goto
bcf
movwf
movlw
movwf
swapf
iorlw
call
btfss
goto
goto
end
There is no mechanism to pull the
InitUSB
CheckSleep
STATUS,IRP
buffer
FSR
1
GetUSB
STATUS,C
idleloop
STATUS,IRP
bufferlen
buffer
FSR
bufferlen,w
1
PutUSB
STATUS,C
PutBuffer
idleloop
; Set up everything so we can enumerate
; wait here until we have enumerated.
; Ok, here’s a good point to put part to sleep if no activity on the bus.
; Check Endpoint 1 for an OUT transaction
; point to lower banks
; point FSR to our buffer
; check end point 1
; If data is ready, it will be copied.
; was there any data for us?
; Nope, check again.
; point to lower banks
; save buffer length
; point FSR to our buffer
; upper nybble of W is buffer length
; lower nybble of W is EndPoint number
; was it successful?
; No: try again until successful
; Yes: restart loop
Advanced Information
CheckSleep is a separate call that takes the bus idle
one step further and puts the device to sleep if the
USB peripheral has detected no activity on the bus.
This powers down most of the device to minimal cur-
rent draw. This call should be made at a point in the
main loop where all other processing is complete.
10.9.6
This example shows how the USB functions are used.
This example first initializes the USB peripheral which
allows the host to enumerate the device. The enumer-
ation process occurs in the background, via an Inter-
rupt service routine.
enumeration is complete, and then polls EP1 OUT to
see if there is any data available. When a buffer is
available, it is copied to the IN buffer. Presumably your
application would do something more interesting with
the data than this example.
EXAMPLES
PIC16C745/765
This function waits until
DS41124A-page 73
Related parts for PIC16C745/P
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![PIC16C54-HS/P](/images/manufacturer_photos/0/4/439/microchip_technology_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16C, 40MHZ, DIP-18
Manufacturer:
Microchip Technology
Datasheet:
![PIC16C55-RC/P](/photos/7/29/72985/150-28-dip_wide_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16C, 4MHZ, DIP-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16C55-XT/P](/photos/7/29/72985/150-28-dip_wide_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16C, 4MHZ, DIP-28
Manufacturer:
Microchip Technology
Datasheet:
![PIC16C74A-04/P](/photos/6/61/66192/150-40-dip_tmb.jpg)
Part Number:
Description:
IC, 8BIT MCU, PIC16C, 4MHZ, DIP-40
Manufacturer:
Microchip Technology
Datasheet:
![PIC1-100-JT](/images/no-image3.png)
Part Number:
Description:
SURFACE MOUNT POWER INDUCTORS
Manufacturer:
RCD [RCD COMPONENTS INC.]
Datasheet:
![TC1014-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1014-5.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.8VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-4.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet: