Multibyte words and Interrupts - A challenge
Bob Ammerman email (remove spam text)
What if you need to share multibyte data between 'task' and interrupt level
code, and you are not allowed to disable interrupts AT ALL.
The 2-byte variable 'shared_var'.
Problem 1: We want to guarantee that interrupt level can always get a
'reasonably current' and consistent value of the variable as set by task
level. (ie: value is never written by interrupt level code)
Problem 2: We want to guarantee that task level can always get a 'reasonably
current' and consistent value of the variable as set by interrupt level.
(ie: value is never written by task level code) (hint this is rather easy)
Problem 3: We want interrupt and task level both to be able to write to the
variable, and always get a 'reasonably current' and consistent value of the
variable. (ie: value is written by both task level and interrupt level code)
(this is rather tricky)
Minimum extra RAM locations used.
Minimum amount of code.
Have at it!
(contract development of high performance, high function, low-level
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
seeking: ubicom lib mem memory
See also: www.piclist.com/techref/microchip/ints.htm?key=interrupt
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the