Microcontroller › PIC › USB WITH PIC18F4550 urgent help
- This topic has 6 replies, 5 voices, and was last updated 13 years, 2 months ago by
P.Maaligai Parai Karuppa Samy.
-
AuthorPosts
-
June 11, 2012 at 6:22 am #1839
rahul saxena
Participantplease 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]
June 13, 2012 at 12:35 pm #8022midhun
ParticipantADC 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….
June 13, 2012 at 12:40 pm #8023midhun
ParticipantSTEP 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.
June 13, 2012 at 5:15 pm #8029Roy Thomas
ParticipantUSB 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
June 14, 2012 at 4:33 am #8031Anonymous
Guestthanks 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…..
June 19, 2012 at 12:22 pm #8077midhun
ParticipantWhat 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!
October 2, 2012 at 10:13 am #8635P.Maaligai Parai Karuppa Samy
Participantplease 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 …….
-
AuthorPosts
- You must be logged in to reply to this topic.