DM164127 Microchip Technology, DM164127 Datasheet - Page 27
![KIT DEVELOPMENT USB 18F14/13K50](/photos/9/4/90419/dm164127_sml.jpg)
DM164127
Manufacturer Part Number
DM164127
Description
KIT DEVELOPMENT USB 18F14/13K50
Manufacturer
Microchip Technology
Specifications of DM164127
Main Purpose
Interface, USB 2.0 Slave
Embedded
Yes, MCU, 8-Bit
Utilized Ic / Part
PIC18F13K50, PIC18F14K50
Primary Attributes
Full Speed (12Mbps), MCU Based
Secondary Attributes
4 Labs: Enumeration, HID Mouse, HID Keyboard, CDC Serial Emulator
Silicon Manufacturer
Microchip
Silicon Core Number
PIC18F14K50, PIC18F13K50
Core Architecture
PIC
Core Sub-architecture
PIC18
Silicon Family Name
Piccolo
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
DM164127
Manufacturer:
Microchip Technology
Quantity:
135
© 2009 Microchip Technology Inc.
FIGURE 2-5:
Referring to the state diagram, the individual states perform these general tasks:
1. STATE 0: this is a delay state used to ensure that the hold capacitor on the ADC
2. STATE 1: this state begins the conversion process by setting the GO_DONE bit
3. STATE 2: checks for a completed conversion (GO_DONE = 0) before allowing
4. STATE 3: this final state reads the ADC result register, converts the result to a
The main point the user should take away from this lab is this: since the USB Frame-
work is a multitasking environment, no blocking code should be used. Therefore, as
shown in this lab, state machines will become the norm in many applications. The
keyboard() state machine is called each time through the main loop. If the condition
that changes the current state to the next state is not met, the state machine simply
returns from the function without changing states. The next time through the main
loop, the condition is once again checked. If the state condition has been met, the
state is changed to the next sequential state. The state variable is declared as a type
static as this will allow the current value in the state variable to remain after a return
from the keyboard().
peripheral has sufficient time to charge before a conversion is initiated.
in the ADCON0 control register.
the state machine to move to the next state.
value between 4 (‘a’) and 29 (‘z’), loads a HID buffer and transmits the resulting
data along the USB to the Host PC for output to an opened .txt document.
STATE DIAGRAM FOR KEYBOARD()
STATE
STATE
STATE
STATE
0
2
1
3
GO_DONE = 0 (Cleared in Hardware)
delaycounter > 9000
delaycounter < 9000
Start ADC Conversion
(Set the GO_DONE bit
• Read ADC result register
• Load HID buffer
• Transmit HID buffer contents along USB
While GO_DONE = 1
(ADC Conversion in Progress)
DS41356B-page 23