piclist 2000\11\06\133759a >
Thread: Multibyte words and Interrupts - A challenge
www.piclist.com/techref/microchip/ints.htm?key=interrupt
picon face BY : 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.

Given:

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)

Criteria:

Minimum extra RAM locations used.
Minimum amount of code.

Have at it!

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use listservspam_OUTspamspam_OUTmitvma.mit.edu?body=SET%20PICList%20DIGEST





seeking: ubicom lib mem memory
<008f01c04820$1026b760$c1ebc540@sciencekit.com> 7bit

See also: www.piclist.com/techref/microchip/ints.htm?key=interrupt
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Multibyte words and Interrupts - A challenge

month overview.

new search...