1. Yes...
2. Sounds about right to me...
3. Datasheet says you've gotta have INTs enabled...but the way it reads, it almost sounds like you don't NEED to have them enabled, in which case, you'd have to read the individual bits themselves.
1. Yes...
2. Sounds about right to me...
3. Datasheet says you've gotta have INTs enabled...but the way it reads, it almost sounds like you don't NEED to have them enabled, in which case, you'd have to read the individual bits themselves.
Thanks for confirming my timer configurations.
On #3, I think we read the datasheet the same way. I believe most, if not all, interrupt flag bits get set whether or not interrupts are enabled. For example, the CCP1 Capture flag (PIR1.2) gets set even though interrupts are disabled. For most, this is usually stated explicitly in the datasheet but, in this case, the datasheet is a bit murky. Since I'll be using While !Capture:Wend loops to wait for rising/falling edges, I'll also monitor the IOC flag (INTCON.0) within the loops and then check the individual pins to determine whether it was set by an RS232 input or RS485 input. Otherwise, I'll just monitor both input pins within the loops.
#2. With a Timer0 reload value of 93, OPTION_REG = %10000100 would give you ~2.6mS
overflow rate @8MHz.
Note there's a 2-cycle inhibit period when writing to Timer0.
#3. Yes. I do this all the time. You can enable individual interrupts and just monitor/reset
each flag bit without global interrupts enabled.
Thanks, Bruce.
#2 That's what I get for doing the math in my head.
#3 Actually, I'm adapting (i.e. stealing) one of your examples for the capture module.
No need for math... PICMultiCalc is all you need
http://www.mister-e.org/pages/utilitiespag.html
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks