[Avrora] How to implement a temperature sensor?
zflai at ust.hk
Tue Aug 28 08:57:46 PDT 2007
I am sorry I could not quite follow your pin tracing statements.
>From the sensor board datasheet, I see the light sensor uses "INT1" and
"ADC1" (5, 42), which corresponds to "PE5" and "PF1" (7, 60) on the mica2
schematic (page 4). I still confuse because in the Mica2 class, the light
sensor is created using
lightSensor = new LightSensor(amcu, 1, "PC2", "PE5");
and I don't understand what corresponds to "PC2". In fact, the declaration
of light sensor constructor is:
public LightSensor(AtmelMicrocontroller m, int adcChannel, String onPin,
but I don't think "PE5" is a pin that controls power.
From: Roy [mailto:roy at cs.hmc.edu]
Sent: Tuesday, August 28, 2007 1:36 PM
To: Mailing list for Avrora simulator users and developers.
Cc: 'Zhifeng Lai'; 'Benjamin Titzer'
Subject: Re: [Avrora] How to implement a temperature sensor?
Take a look at page 4 of the Mica2 schematic at:
This shows the ATMega128 processor used on the mica2 motes. It has
the pins that you are looking for. In fact, this is the actual chip
that Avrora simulates. A google search for "atmega128" will turn up
the (BIG!) PDF of the datasheet for this chip. Many, but not all, of
the pins from the ATMega128 are exposed to sensor boards and other
hardware via the 51-pin connector on the mica2 mote, displayed on page
3 of the mica2 schematic.
To better understand what is going on, try tracing the pin from the
light sensor back to this processor. This path will go from the upper
right hand corner of the basic sensor board data sheet available at:
to the 51-pin connector on that same datasheet. Then to the 51-pin
connector on the Mica2 schematic, and finally to the ATMega12 on the
Mica2 schematic. You can assume that pins with the same label on a
given schematic are connected, and that pins in the same position on
the 51-pin connector across schematics are connected.
I hope this helps and good luck!
But be warned as the reading is a bit heavy :-) Regardless,
On Tue, Aug 28, 2007 at 01:12:00PM +0800, Zhifeng Lai wrote:
> Dear Benjamin,
> Thanks a lot for your information!
> After consulting Mica2 datasheet, I find that Mica2 has 51 pins. However,
> the number of pin assignments defined in Avrora (ATMega128.java) is 64. I
> cannot understand the correspondence between these two. In particular, the
> temperature sensor of my evaluated application uses the following pin
> TOSH_ALIAS_OUTPUT_ONLY_PIN(TEMP_CS, PW4);
> TOSH_ALIAS_OUTPUT_ONLY_PIN(TEMP_SCK, PW6);
> However, I could not find pins named "PW4" and "PW6" in Avrora. Could you
> help me clarify the bindings? Thank you very much!!!
> Best regards,
> Yours sincerely,
> Zhifeng Lai
> -----Original Message-----
> From: Benjamin Titzer [mailto:titzer at CS.UCLA.EDU]
> Sent: Tuesday, August 28, 2007 4:28 AM
> To: Mailing list for Avrora simulator users and developers.
> Cc: 'Zhifeng Lai'
> Subject: Re: [Avrora] How to implement a temperature sensor?
> You need to look at the constructor code in the LightSensor. It uses the
> names of the pins to figure out where it connects to the MCU. Internally
> there is an API for connecting pins and ADC inputs. The light sensor code
> should be pretty straightforward for explaining this.
> Imagination is more important than knowledge.
> -- Albert Einstein
> On Tue, 28 Aug 2007, Zhifeng Lai wrote:
> > Dear all,
> > It seems that Avrora does not implement a temperature sensor, I
> > want to create it using the LightSensor template and add it to the mica2
> > platform. Could you tell me how to correctly connect it to the
> > microcontroller. In particular, I want to understand the meaning of this
> > statement
> > lightSensor = new LightSensor(amcu, 1, "PC2", "PE5");
> > in "avrora.sim.platform.Mica2.addDevices" method. Many thanks!
> > Best regards,
> > Yours sincerely,
> > Zhifeng Lai
> Avrora mailing list
> Avrora at lists.ucla.edu
More information about the Avrora