Thanks...there's some top tips there.
Just a thought here - is it even possible to get reliable results with mechanical switches & interupts?
By this I mean, a mechanical switch normally needs a debounce, else you'd get more than one interupt for every time the switch 'settled'? In my situation, it's importnat that there's just one 'trigger' for every revolution of the encoder wheel (so I can establish how many interupts/black stripes the PIC has counted over one rev)...if I used an interupt for the magnetic switch, there'd be a possibility of not just one interupt...but several in quick succession...which will cause a bit of 'fog' whilst trying to confirm that my wheel, circuit & PIC are all in sync & counting 48 stripes per turn!
By the way...I've now dabbled with Darrel's "Hello World" which will suit my encoder wheel needs perfectly....after wrestling with 'pin' polling for weeks with my encoder wheel & getting very erratic results, I'm one very happy McSpank here today! October 05, 2002 maybe was a good day...but I can say without any shadow of a doubt, for me the 19 May 2009 was a lot better!!
Just a couple of small suggestions for Darrel's website (to save avoid a lot of newbie-esque puzzlement) - on Darrel's very first hello world code page, it might be worth saying that a user will need to establish their own PIC variant's 'INT' pin, along with perhaps a couple of PIC specific examples. (it might be ovbious to you old hands, but looking at the plethora of pins PICs have, it wasn't obvious to me!)
Also, for what it's worth...the 16F690 is perhaps the most common chip that newbies come into contact with at the moment (on account it's bundled with Microchip's very popular PikKit2 starter kit)...I had a problem with Darrel's "Hello World" code when I first compiled ...."error: variable wsave3 position request 416 beyond ram_end 367.", ultimately meaning a line in Darrel's DT_INTS-14.bas file needed commenting out - that might also be worth a mention too? (or at least some mention on a FAQ page?)
Anyway, a hearty thanks to Darrel... without his effort towards making interupts easy with PICBasic , I'm sure I would have left interupts for another day (ie sometime in 2023!)
Bookmarks