************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Last edited by sayzer; - 8th February 2008 at 19:11.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Wow, thankyou for all of your replies.
I forgot to mention that my crystal is 20MHz and both CCP1 and CCP2 are being used for HPWM.
I found PicMultiCalc and it is saying that I can use the 8-bit timer (Timer0) for an error of 0.371%. It says that if I use the 16-bit timer I will get an error of 0%. Now I have decided that I will use the 16-bit timer only if it won't interupt my HPWM. The HPWM is driving two motors. I am not at all familure with these timers and I don't know how to set them up or know when to start my 10ms loop so that the gyro can be read at the start of every loop at 100Hz (10ms intervals). Integration calculations and other processes are carried out after the gyro has been read. If all calculations and procesess have been done before the next loop should start, the processor should wait until the timer flag or whatever signals the loop to start over.
FYI I am making a balancing robot.
Said it before, I'll say it again...
Start simple...
Get the LED blinking at a known rate under an interrupt drive (or just get an LED blinking), get the HPWM working on all channels in all situations, get the interfaces working, THEN tie them all together.
Otherwise you'll be shooting yourself in the foot wondering why...no more...just wondering WHY!!!!
Well ok; so it's just a trial and error thing then? I'll just experiment with the PICMULTICALC values by plugging them into the right registers and i'll see how I go. BTW I have no idea of how to use an interupt. Anyhelp in using interupts in PBP relating to what I need will be very much appriciated.
I was hoping someone here has done what I want done before. Or perhaps someone could link me somewhere, but thanks for all of your help.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I saw that balancing robot on the paralax website. It doesn't use a gyro and an accelerometer. Useless on a sloped surface.
Ok I got the timer going, but brace yourself for a possible kalman filter question. I havn't found a single website that can explain kalman filters in laymens terms.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks