- This topic has 6 replies, 5 voices, and was last updated 11 years, 11 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › USB WITH PIC18F4550 urgent help
please i need help to run USB module in PIC18F4550……….
i want to display ADC data on hyperterminal using USB in PIC18f4550……
if anyone have code for this…. ..
please send me on [email protected]
ADC data after conversion will be found in two registers ie, ADRESH and ADRESL. you need to save the ADRESH value to a variable which is intiger in format. now you need to rotate the value of variable left 8 times. Now the * LSB will be free. You just OR the ADRESL value with this variable.
This steps will give the value of ADC in a single variable.
Now you just seperate each digit of the same variable by finding the modulus of the variable by dividing it with 10.
JUST TRY THIS….
STEP 1: Read the value from ADRESH and ADRESL.
STEP 2: Combine both to a single variale.
STEP 3: Seperate each digit.
STEP 4: Convert to ASCII.
STEP 5: Send it to serial port, by placing it in TXREG.
USB Module in 4550 can be used in different classes.
To keep things simple search code for HID class in PIC. Microchip Has example code.
Then read ADC and convert to BCD and then to ASCII and then to USB.
But Hyperterminal, It is for serial port. If you want PIC to work as USB to serial I think CDC classs is the way to go. Not sure anyway.
All the best
Roy Thomas
thanks guys….but i want to use inbuilt USB module of PIC18F4550…………..
i have done the program till adc data conversion with ascii value………………..
now i want to display it on my PC using USB module……….for doing this presently i m using CDC program provided by microchip…………………………….
but i can’t get the succes to implement this……pls help me…..
What you cah do is you can change your compiler to microc from MICROCHIP. it will be a very useful tool for you to do thic work. there are so many inbuilt functions present in this tool.
You can use inbuilt USB library.
And also there will be example programs with this tool, which will make your work an easy task.
Best of luck!
please tell how to used inbuild usb data communication please shared the step for compiling inbuild usb
or
please share the coding
please,please ,help me …….