Hi Sergio, Look at the meshbean platform in tinyos-2.x-contrib/ethz/meshbean900/tos/platforms/meshbean/chips/rf230
I have the attached files there, and I am sure these will be good for your platform as well. Best, Miklos On Sat, Oct 29, 2011 at 4:27 AM, Sergio Gonzalez <[email protected]> wrote: > Hi Miklos, > > Thank you so much for your previous help. I ended up designing new boards > for my custom zigbit implementation and finally got TinyOS running on them. > So far I've got LEDs blinking and serial comms (TestSerial & Printf) > working. However, I have been unable to get the radio working. > > The only thing I've noticed so far is what appears to be an incorrect pin > configuration in /tos/platforms/zigbit/chips/rf320/HplRF230C.nc that does > not correspond to the presupposed internal pins connections in the zigbit > module. The original file specifies the following configuration: > > ... > HplRF230P.PortCLKM -> IO.PortD6; > HplRF230P.PortIRQ -> IO.PortD4; > ... > SLP_TR = IO.PortB7; > RSTN = IO.PortA6; > SELN = IO.PortB0; > ... > > Obviously, this configuration is intended for the IRIS mote, so I changed it > for zigbit as follows: > > ... > HplRF230P.PortCLKM -> IO.PortB0; // PortB5 <- wrong as per P. Sommer > (no?) // PortD6; > HplRF230P.PortIRQ -> IO.PortE5; // PortD4; > ... > SLP_TR = IO.PortB4; // PortB7; > RSTN = IO.PortA7; // PortA6; > SELN = IO.PortB0; // OK! > > I don't know whether I am wrong here, and what else I am missing to get the > radio working accordingly. I would greatly appreciate your help on this > matter! > > Best regards, > > Sergio > > > On 08/24/2011 02:18 PM, Miklos Maroti wrote: >> >> Hi Sergio, >> >> Just turn on all ports and all pins, just to make sure it is not >> connected to something else. I do not have a good documentation of >> zigbit. Also, you can try to send characters over the uart, but that >> is much harder to do, you have to get the baudrate right, which is >> hard with an uncalibrated RC oscillator. >> >> Miklos >> >> On Wed, Aug 24, 2011 at 10:17 PM, Sergio Gonzalez<[email protected]> >> wrote: >>> >>> Hi Miklos, >>> >>> I did set the corresponding DDR register accordingly, which assumes that >>> my >>> LEDs' cathods are wired to the Zigbit pins, and anodes are connected to >>> Vcc >>> through a resistor. >>> >>> Thanks for your help! >>> >>> Sergio >>> >>> ----------------------------------- >>> #include<avr/io.h> >>> #include<avr/wdt.h> >>> >>> int main(void) >>> { >>> while(1) >>> { >>> MCUSR&= ~_BV(WDRF); >>> wdt_disable(); >>> >>> DDRG |= _BV(DDG0); //DDRG |= (1<<DDG0); >>> PORTG&= ~_BV(PG0); //PORTG&= ~(1<<PG0); >>> while(1); >>> return 0; >>> } >>> } >>> ------------------------------------ >>> >>> On 24/08/2011 12:58 PM, Miklos Maroti wrote: >>> >>> Well, just read the datasheet carefully. If you can upload the >>> program, then probably the MCU is working fine. You might need to set >>> the DDR registers. Best, Miklos >>> >>> On Wed, Aug 24, 2011 at 9:10 PM, Sergio Gonzalez<[email protected]> >>> wrote: >>> >>> Hi Milkos, >>> >>> Thanks for your reply. I tried a simple "hello world" program to lit an >>> LED >>> using AVR studio (no TinyOS). Again, the program loads OK, but neither of >>> my >>> two custom Zigbit boards show sign of life. Maybe I screwed them up while >>> soldering, or maybe there is some trick to getting port G working (which >>> is >>> the port I wired my LEDs to). I suppose I'll redesign my board to wire >>> LEDs >>> to pins B5-B7 and try again. I'll follow up with another email later on. >>> >>> Much thanks! >>> >>> Sergio >>> >>> >>> On 23/08/2011 12:10 AM, Miklos Maroti wrote: >>> >>> Hi Sergio, >>> >>> Write a small C program to test the LEDS and that the Zigbit is >>> functional. Once you have the LEDS working in C, then you can try the >>> tinyos distribution. >>> >>> Best, >>> Miklos >>> >>> On Tue, Aug 23, 2011 at 2:09 AM, Sergio Gonzalez<[email protected]> >>> wrote: >>> >>> Hello, >>> >>> I am hoping someone can provide either pointers or direct advice on >>> getting >>> TinyOS 2.x to run over a standalone Atmel Zigbit device. I have been >>> trying >>> to do so for the past few days with no success. I designed a simple >>> breakout >>> board for this device and followed the steps to implement a new TinyOS >>> platform as previously documented by Swiss researchers for the Meshbean >>> 900. >>> This is my setup: >>> >>> OS: Windows (Cygwin) >>> Device: ATZB-24-A2 (Zigbit) >>> Programmer: AVRisp MKII >>> LEDs connected to pins 19-21 (ports G0-G2) >>> >>> I am unable to at least get my LEDs lit (yes, I’ve tested the LEDs, they >>> are >>> functional). I am able to program the device by first creating the binary >>> image through TinyOS, and then upload it employing AVR Studio 5.x. >>> However, >>> the program shows no sign of life. Building a binary image as if it were >>> an >>> Iris mote won’t work either. When programming the device, I have setup >>> fuses >>> as: 0xFF (E), 0x99 (H), 0xE2 (L); and 0xFF (E), 0x9C(H), 0x62(L), with no >>> luck for either case. I’ve worked with TinyOS for years now employing >>> both >>> the Micaz and the Telosb platform, but it is my first time working with a >>> Zigbit. I do not have a JTAG programmer, so I am unable to debug the >>> program >>> and verify whether it is even running properly. Any advice? >>> >>> Thanks! >>> >>> Sergio >>> >>> >>> >>> >>> _______________________________________________ >>> Tinyos-help mailing list >>> [email protected] >>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >>> >>> >>> > >
HplRF230C.nc
Description: Cdf file
HplRF230P.nc
Description: Cdf file
/*
* Copyright (c) 2007, Vanderbilt University
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without written agreement is
* hereby granted, provided that the above copyright notice, the following
* two paragraphs and the author appear in all copies of this software.
*
* IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
* UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Author: Miklos Maroti
*/
#ifndef __RADIOCONFIG_H__
#define __RADIOCONFIG_H__
#include <MicaTimer.h>
#include <RF230DriverLayer.h>
#include <util/crc16.h>
enum
{
/**
* This is the value of the TRX_CTRL_0 register
* which configures the output pin currents and the CLKM clock
*/
RF230_TRX_CTRL_0_VALUE = 0,
/**
* This is the default value of the CCA_MODE field in the PHY_CC_CCA register
* which is used to configure the default mode of the clear channel assesment
*/
RF230_CCA_MODE_VALUE = RF230_CCA_MODE_3,
/**
* This is the value of the CCA_THRES register that controls the
* energy levels used for clear channel assesment
*/
RF230_CCA_THRES_VALUE = 0xC7,
};
/* This is the default value of the TX_PWR field of the PHY_TX_PWR register. */
#ifndef RF230_DEF_RFPOWER
#define RF230_DEF_RFPOWER 0
#endif
/* This is the default value of the CHANNEL field of the PHY_CC_CCA register. */
#ifndef RF230_DEF_CHANNEL
#define RF230_DEF_CHANNEL 11
#endif
/* The number of microseconds a sending MESHBEAN mote will wait for an acknowledgement */
#ifndef SOFTWAREACK_TIMEOUT
#define SOFTWAREACK_TIMEOUT 1000
#endif
/*
* This is the command used to calculate the CRC for the RF230 chip.
* TODO: Check why the default crcByte implementation is in a different endianness
*/
inline uint16_t RF230_CRCBYTE_COMMAND(uint16_t crc, uint8_t data)
{
return _crc_ccitt_update(crc, data);
}
/**
* This is the timer type of the radio alarm interface
*/
typedef TThree TRadio;
typedef uint16_t tradio_size;
/**
* The number of radio alarm ticks per one microsecond
*/
#define RADIO_ALARM_MICROSEC 1L
/**
* The base two logarithm of the number of radio alarm ticks per one millisecond
*/
#define RADIO_ALARM_MILLI_EXP 10
#endif//__RADIOCONFIG_H__
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
