sbi() and cbi() should work fine, as long as you are careful
to not touch pins used by the radio. I wouldn't go writing
whole registers with outp() if there is any shared pins.
Double check the schematic for the mote you are using to make sure.

I have some PWM code in my code bolus:
    http://www.etantdonnes.com/Motes/robocode.tar.gz
I forget what reg DDRB is, but I use the timer/counter pins
on the ATMEGA 128 so either I did something right, or you don't
need to touch DDRB...

MS



Birger Becker wrote:
Hi!
I'm currently programming PWM (pulse width modulation) on an ATMega 128 in a
tinyOS-environment. Programming of PWM is ready, but now I wanted to remote
control one Mote with the PWM by another, which is connected to a
programming board.

So I used TOSBASE and SimpleCmd for basic and put my PWM code in the
command-process of SimpleCmd. The TOSBase-Mote is then administrated by
programming board using UART and it sends commands via RadioCRCPacket to
SimpleCommand, which receives them by GenericComm. The remote control works
fine, I checked by LEDs.

To realize PWM, I used register DDRB of ATMega 128 to set output-Pins. But
when any bit of this register is set to 1, no Radio-Packets will be received
anymore.
Code like outp(0x20, DDRB) (in tinyOS 1.1.0) and manually set bits by sbi()
and cbi() (in tinyOS 1.1.11) results the same curious effect.

How does GenericComm or RadioCRCPacket use DDRB-register and how can I use
PWM-ports without getting every Radio-Connection crashed.

Many thanks,
BiBe


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to