Hi Antonio,
The example is very clear! Very grateful!
Regards!
Massinissa
________________________________
De : antonio rosa <antoniorosarodrig...@gmail.com>
À : hafid bbbbbbbbb <che_...@yahoo.fr>
Envoyé le : Jeudi 27 Octobre 2011 1h23
Objet : Re: [Tinyos-help] Re : Urgent! How to generate PWM signal to excite a
sensor on IRIS ?
Example:
1) Initialize pwm:
PRR1 &= ~(1 << 3);
OCR3A = 0X545;
TCCR3B |= (1<<3)|(1<<0);
2) Active pwm:
TCCR3A |= (1 << 6);
3) Desactive pwm:
TCCR3A &= ~(1 << 6);
2011/10/26 hafid bbbbbbbbb <che_...@yahoo.fr>
Hi,
>Thanks for your valuable reply, I read the chapters that suggested to me and i
>understand now how to use PRR1, OCR3A,TCCR3B. One problem left is how to count
>N pulses and then stop Timer 3 by disabling the correspondent bit in PRR1?. I
>do not know if this is doable but if the correspondent Output compare match
>interrupt is enabled , and its interrupt routine can be changed somehow to
>count N pulses, maybe, it would solve this. Frankly, i don`t know how to do
>this! Any idea?
>Best Regards !
>Massinissa
>De : antonio rosa <antoniorosarodrig...@gmail.com>
>À : hafid bbbbbbbbb <che_...@yahoo.fr>
>Envoyé le : Mercredi 26 Octobre 2011 15h10
>Objet : Re: [Tinyos-help] Urgent! How to generate PWM signal to excite a
>sensor on IRIS ?
>
>
>
>Hi,
>
>I have worked with PWM in atmega 1281 and TinyOS-1.1.15. I use the Timer3
>(Timer2 (reserved by radio) and Timer1 is used by TinyOS) and the following
>registers:
>PRR1
>OCR3A
>TCCR3B
>
>
>Also you should read the datsheet: chapter: 16. 8-bit Timer/Counter0 with PWM
>and the chapter 17.
>
>
>
>2011/10/26 hafid bbbbbbbbb <che_...@yahoo.fr>
>
>Hi everybody,
>>I want to excite a sound transmitter with a train of N pulses at about
>>17.5 - 20KHZ. So, I made a basic sensorboard as described here
>>http://www.etantdonnes.com/Motes/MicaBOB/ to get all the 51 pins connector
>>pins and after consulting the atmega1281 datasheet i noticed that
>>manipulating the timer/ counter registers is the only way to generate such a
>>signal (PWM). Therefore, I have a couple of questions:
>>Which timer is most suitable in my case without interfering with the Radio
>>and TimerMillic and other components using timers?
>>Is there any interfaces to manipulate safely these registers in tinyos 2.1?
>>any similar example, or code snippet ?
>>Please shareyour experience with me.
>>Thanks in advance for your help.
>>Massinissa
>>_______________________________________________
>>Tinyos-help mailing list
>>Tinyos-help@millennium.berkeley.edu
>>https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
>
>_______________________________________________
>Tinyos-help mailing list
>Tinyos-help@millennium.berkeley.edu
>https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help