[Avrora] How to implement a temperature sensor?
roy at cs.hmc.edu
Mon Aug 27 22:35:43 PDT 2007
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 therefore
> > 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