Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
HOME
FREE DOWNLOAD
FREE DOWNLOAD
Search
ABOUT
ALL POSTS
POPULAR POSTS
PLL Circuit
The PLL circuit converts 4MHz clock to 48MHz clock .So, we need 4MHz clock . We have
to divide the clock in such way so that we can get result 4MHz. Look at here , If we use
20MHz divide it by 5 and we get 4 .Example : (20/5)=4 ,(12/3)=4.. .We have to dene this
in the source code.
Now let's create a project in Proteus 8.
Proteus 8 Circuit :
Step 1:
Step 2:
Powered by Blogger.
Live Trafc Stats
Step3 :
ALL POSTS
15 (15)
Jul (5)
Jun (2)
Jan (8)
PIC Experiment Kit [for 28pin] with PCB
Design
Usb 1.0 Interfacing With PIC Microcontroller
[step...
Rs 232 , Serial Communication with PIC
Microcontro...
How to Create Project in Proteus 8_3
Step 4:
TAGS
pic18f2550
(14)
microcontroller (11) using
(11) How to (9) step by step (9)
Step 5:
time (1) tone (1) usb 1.0 (1) voltmeter (1) voting (1) work (1)
Step 6:
GOOGLE+ FOLLOWERS
Your email
Address...
Your
email
Address...
Subscribe
Microcontroller T
52 likes
Step 7:
Like Page
Share
Now let's create a project in MikroC , because we need source hex le to load .
MikroC Code :
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
1. As we know PLL circuit take input 4MHz clock . So we have to divide 12MHz by 3 so
that we can get 4MHz clock .If we use 4MHz we have no need this part .
2 & 3 . We are using USB 1.0 and it's High Speed clock 48MHz .So we have to devide it
by 2
4 . Here we are using 12MHz Crystal clock and the oscillator selection should be HS
Oscillator
5 . We have to enable voltage regulator .Basically it is an internal 3.3 voltage regulator
of pic18f2550.If we enable it , it is required to connect vusb pin with a 220 nf capacitor .
#Source Code :
unsigned char receivedata[64] absolute 0x500;
//
<--Variable Declaration
//<--Interrupt function
}
void main()
{
HID_Enable(&receivedata,&senddata);
while(1){
while(!HID_Read());
//<--for reading
for(i=0;i<64;i++){
senddata[i]=receivedata[i];
}
while(!HID_Write(&senddata,64)); //<--for writting
}
}
void Interrupt(){
USB_Interrupt_Proc();}
void Interrupt() is one User Dene function which contains USB_Interrupt_Proc()
function inside . Interrupt makes restriction for something .When we enable the
interrupt function , the connection is disabled.When we disable the interrupt function ,
the connection is enabled .
3. HID_Enable(&receivedata,&senddata);
This function will enable the USB1.0 .It keep received data at receivedata and send data
which are stored in the senddata variable .
char HID_Write();
This function receive data. If receiving is failed ,it returns 0
.Otherwise it returns the numbers of data .while(!HID_Write());
It means , this function tries to send data until data are being sent .
Step 8:
Step 9:
Adding descriptor le with MikroC Project .
Step 10:
Step 11:
Step 12:
Step 13:
Step 14:
Step 15:
In proteus Simulation we need to install virtual usb .
Step 16:
Run Project
Output:
Now go to the Tool >>HID Terminal >> click on Terminal .
Thank You!
Good (0)
Bad (0)
Best (0)
Reactions:
? Google+
Newer Post
? Stumble
Home
? Digg
Older Post
Related Posts Widget
0 comments:
Post a Comment