PICcoder.co.uk Forum  


Post a new message in "USB"
Name:
Subject:
This image contains a scrambled text, it is using a combination of colors, font size, background, angle in order to disallow computer to automate reading. You will have to reproduce it to post on my homepage Enter what you see: *
tips: hit Reload page before writing a text if you have difficulty reading characters in image
topic icon:
no
boardcode:
 Colour:  Size:   Close all tags
Message:

emoticons
B) ;) :) :P
:laugh: :ohmy: :sick: :angry:
:blink: :( :unsure: :kiss:
:woohoo: :lol: :silly: :pinch:
:side: :whistle: :evil: :S
:blush: :cheer: :huh: :dry:

Topic History of: USB mouse connections 18F
Max. showing the last posts - (Last post first)
Author Message
jdsanchez hi!



im a kind of freshmen about USB with PIC, i donwloaded the code from Microchip bit it isnt work, i miss a file named "pic.h", somebody know where can i find it?



maybe im lookink at the wrong file at Microchip's page, but i dont know

someone please help me
chib Hi !



I have just put : YVel=ReadADC();

YVal=YVel/2;

Yval=YVal/2;



and XVel=ReadADC();

XVal=XVel/2;

Xval=XVal/2;



and it works so I don't edit ..... lol

I have 2 conversion, but if it's a ok for a mouse, it will be ok for my application !



Thanks a lot Dariog !! it was very helpful !



Now I have an other Pb but it's something else so I will make a new thread and I think you can help me .... (if you have some time, obviously)



(if somebody want my whole conveter i can post it)
dariog Hi Chib, sorry, I was not online...



but I see you did succed! very good!!



To convert 10 bits to 8, you can divide by 4 or shift twice to the right i.e. XVel >>= 2;



To make it faster, well... usually that should not take longer than some uSecs... if I'm not wrong.

How often are you calling the conversion routine? I usually put it in a interrupt, or in the main loop via a divider (usually some 20..100 samples a sec is okay for a mouse)
chib hello it's me (again)



for the ten bit I dived by 2 and then by 2 and it works !



so I have a working A/D converter, I have another pb but it is different, i will make a new thread tomorow



see ya !
chib hum ....



I am stupid ... for a 10 bit i hav defined an 8 bit number ....



So the pb with the 1 is solved ....
chib hew sorry again ...



in the watch i have seen that :



00000110 10111101



the two bit in bold are always at 1 !!



why ?