On Aug 19, 2007, at 3:31 PM, Ákos Maróy wrote:
I'm trying to get the Oscilloscope application read samples from an
ADC
input at 2kHz. This required a finer-grained timer then the
millisecond-based timer originally in the application.
Unfortunately, I haven't seen a 32kHz implementation of the Timer
interface for the msp430 platfrom. But, I found an Alarm32khz32C
implementation - sounds good enough.
I added such a component to OscilloscopeC, and tried to fire it at an
interval of 256 cycles. (The target 2kHz would be at 16 cycles for the
32kHz clock.) But, I'm bumping into an unexpected issue here: the
fired
event for the Alarm interface is async. Thus, I'm getting the
following
warnings when compiling:
OscilloscopeC.nc:176: warning: `Read.read' called asynchronously from
`Alarm.fired'
OscilloscopeC.nc:86: warning: non-atomic accesses to shared variable
`samplingInterval':
OscilloscopeC.nc:104: warning: non-atomic write
of course, the very reason of my change is to call Read.read() from
Alarm.fired() - how would I do that? also, of course I'd have to write
to some shared variables so that the data read from Read can be sent
over the network.
How could I achieve this functionality?
Or, is reading at 2kHz just too fine-grained by using these timers?
The TinyOS programming manual covers this topic (async).
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help