Home
User Manual
Contents
1. There are two common reasons can be in this case the Bootloader timed out Orincorrect tty given to the AVRDUDE Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 8 H 8000 Sz kesfeh rv r UNIGONIE H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 root UCWSN opt SVN apps RadioCountToLeds build ucmini N zet Keres s Terminal S g root UCwsN opt SVN apps RadioCountToLeds build ucmini avrdude cavrl109 pml28r fal P dev ttyUSB8 Uflash w main srec a b57688 Connecting to programmer Found programmer Id AVRBOOT type S Software Version 1 5 No Hardware Version given Programmer supports buffered memory access with buffersize 128 bytes Programmer supports the following devices avrdude AVR device initialized and ready to accept instructions 100 8 00s Device signature Oxlea7 l NOTE FLASH memory has been specified an erase cycle will be performed To disable this feature specify the D option erasing chip reading input file main srec input file main srec auto detected as Motorola S Record writing flash 9634 bytes 100 2 12s 9634 bytes of flash written verifying flash memory against main srec load data flash data from input file main srec input file main srec auto detected as Motorola S Record input file
2. mode TWI FAIL return TWI FAIL delay mziBbH TIMEOUT H RES 1f TMI packet readiBH ADDRESS 27 data TWI FAIL return TWI FAIL J JIEPCBH Offi TWI FAIL return TWI FAIL return TWI SUCCESS Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 16 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Converting int32 t BH Measure ii int3z2 t ret uint t reBut 2 0 0 1 BH Heasure BH ONE SHOT H RES amp rxBuf l TWI_SUCCESS d ret reBuf 0 lt lt 8 ret rxBuf 1 ret B3 return ret The result value is a fixed point integer with two decimals the value is the measured light quantity expressed in Lux Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 17 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 BMA180 3D Acceleration sensor The measureable data e Acceleration X Y and Z axes e Temperature Interface SPI USARTO Chip Select PORTB 6 The most important command bytes in fact they are register and EEPROM addresses which controls the sensor s internal logic define BHA C
3. Contact the PCB connect the PCB connector to the JTAG labeled surface with gold plated pins of the device e Carefully screw the screws e Connect the JTAG cable to mini and the AVR Dragon Connection surface Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 10 H 8000 Sz kesfeh rv r UNIGOMB H 1117 Budapest Ber nyi t 15 INFORMATIKAI KFT Feh rv ri t 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 ols Debug Window Help fax od A window pops up where the programming mode JTAG connection can be handled Check if the correct device is selected ATmega128RFA1 and the JTAG mode is active at the Programming mode combo box Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 11 H 8000 Sz kesfeh rv r Ber nyi ut 15 Telefon 36 22 511 130 Fax 36 22 511 131 UNG OM INFORMATIKAI KFT www unicomp hu AVR Dragon in JTAG mode with ATmegal28RFA1 Main Program uses LockBts Advanced HW Setings HWirfo Auto Device and Signature Bytes ATmega 128RFA1 T Signature not read Erase Device Read Signature Programming Mode and Target Settings JTAG mode Settings Disabled Changes to daisy chain settings are only valid from the next time the programming dialog is opened Daisy Chain Detecting on USB AVR D
4. If the Bootloader finishes waiting for PC connection USB it switches ON all leds two times and starts the main application USB programming Linux To program the mini via USB cable you have to follow these steps e Compile your application to SREC e CD tothe folder of your SREC e Connect mini to the PC with the USB cable Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 7 H 8000 Sz kesfeh rv r UNIGOMB H 1117 Budapest Ber nyi t 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 e Execute following command within 10 secunds where the ttyUSBO must be overwritten to the correct tty of your connected device e The AVRDUDE writes to the console its success Picture 7 or fail e If the Bootloader timed out Picture 6 mini must be restarted and try again to execute the command above i root UCWSN opt SVN apps RadioCountToLeds build ucmini F jl Szerkeszt s N zet Keres s Terminal S g root UCWSN opt SVN apps RadioCountToLeds build ucmini avrdude cavr109 pm128r 4 fal P dev ttyUSBO Uflash w main srec a b57600 Connecting to programmer avrdude butterfly recv programmer is not respondi ng root UCWSN opt SVN apps RadioCountToLeds build ucmini LI Picture 6 Bootloader timed out The not responding error message means that mini did not answer its programming request
5. for 8Mhz descibed int he followings Measure the speed of the MCU by pressing the Read button The AVR Studio measures the speed and offers a calibration value which can be written to the OSCCAL register to exactly set the frequency of the oscillator Oscillator Calibration Byte Calibrate far frequency 8 0 MHz Value Address Hash kB Eeprom The OSCCAL register can tune the RC oscillator to run faster or slower The value can be given to the register with the following simple expression OSCCAL xB The AVR Studio can write this value to a given address of the EEPROM to manage this setting from the firmware with same code The calibration value usually differ at devices Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 13 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Sensors Sensors can be accessed via SPI and I C interfaces The FC is an address based master slave multi access bus implementation where the master MCU starts the transmission and it manages which slave device may use the bus by calling them with the address The SPI bus doesn t carry device addresses the channel access are controlled by chip select pins The MICU can select a device by pulling its chip select pin low Only one
6. mini 4th of March 2011 ucwsn unicomp hu 4 WIN ICE LW H 1117 Budapest INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 1 456 0998 Fax 36 1 456 0999 H 8000 Sz kesfeh rv r Ber nyi ut 15 Telefon 36 22 511 130 Fax 36 22 511 131 www unicomp hu First steps The battery should be inserted with the side up Incorrect polarity can damage the device Picture 2 Correct battery placement The device can be turned ON or OFF by the switch circled on the photo below Switch ON E AN NS H ri MER EB RK M I Gw E lt 0 ec O Cc Q p c mg Picture 3 Switching ON OFF mini Users Manual v0 1 UCMote mini Ath of March 2011 5 ucwsn unicomp hu H 8000 Sz kesfeh rv r WIN ICE LW H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 USB power When USB power presents mini automatically switches to USB power it s not necessary to turn the device off When you are using rechargeable battery the device starts to recharge it charging indicator LED lights up Picture 5 When the charging has been completed the indicator blacks out During the charging process the temperature of the battery should not go over 50 Celsius If you observe overheating or any physical deformation on the battery immediately pull out the USB cable because the explod
7. COIIB H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri t 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Writing with page program function void M25 PageProgram unsigned long address unsigned char x buffer unsigned char len unsigned char i U unsigned char j unsigned char txBuf 4 len txBuf U H25 FP txBuf 1 unzigned chariffaddress UNFFOOUO 16 txBuf 2 unzigned chariffaddress x FF 0 33 by txBuf 3 unzigned charj addrezsg amp Ux FF for i 4 i lt len 4 amp amp i lt 256 i txBuf 1 buffer J J H25 Select SPI command amp teBut 0 buffer len 4 M25 DeSelect Reading void M25 Read ungigned long address unsigned char butfer unsigned char len d unsigned char 1 unsigned char txBuf 4 len txBuf U M25 READ txBuf 1 funsigned chari address bk UsFFUUUD gt gt 16 txBuf 2 funsigned char address UEUUFFOU 33 8 txBuf 3 funsigned charifaddress UEOUOUFF forfi iii lt len 4 amp amp i x 2563 14 txBuf i O M25 Select SPI commandi amp txBuf U0 butter lentd H25 DeSelect i Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 21
8. EO H 1117 Budapest Ber nyi t 15 INFORMATIKAI KFT Feh rv ri t 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Datasheet MCU sm JTAG for debugging and communication for external power and communication User interface 4 LEDs 2 LEDs for external power presence and charging indicator Both CR2450 non rechargeable and LIR2450 rechargeable coin battery Battery charger charging LIR2450 battery in case of present external power TinyOS 2 x and NesC compatibility Enclosure Hammond 1551F outside dimensions 50mm X 35mm X 15mm Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 3 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 ATTENTION For the error free operation high temprature above 85 Celsius and the direct contact with water should be avoided The temperature affects the battery capacity Besides USB power mini can be operated from both rechargeable LIR2450 and non rechargeable CR2450 coin battery Since the voltage level of the two types of battery differs CR2450 3V LIR2450 4 2 3 6V and in battery mode there is no regulator between the power source and the MCU R Picture 1 Battery type selection Users Manual vO 1 UCMote
9. H 8000 Sz kesfeh rv r UNIGONIE Ber nyi ut 15 INFORMATIKAI KFT Telefon 36 22 511 130 Fax 36 22 511 131 www unicomp hu User Manual UCMote mini H 1117 Budapest Feh rv ri ut 130 Telefon 36 1 456 0998 Fax 36 1 456 0999 Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu weiss ei SE Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Table of Content AAS NG Ol ee 3 PTT BINT PO I M 4 URS GSS mH 5 JSB POWO C TERT 6 EE eelere eegen 7 Programming THE M L EE 7 USB DROS aI SU INN a EE 7 MAG programmihe AVR Studio E 10 SENS ae i er an asni OI 14 SHT21 Temperature and Humidity sensor cccssccosesescsssescusrencustecescscssrencusrencusteneestscacssneasrens 14 sd Indie ee 14 BH1750fvi Ambient light ses EE 16 Cines Sr naees 16 BMA180 3D Acceleration Sensor nennen nnne nennen AREA ARENA 18 Pa C OGE NE IDE 19 M25P16 16Mbit flash one e e saa M usua Ea des saeua noa s vacui bU ses Pee dude E PPS Cas PA ME 20 PaM CCS aeria attt Een av die II NM dE TM M MESH IURI 20 Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 2 H 8000 Sz kesfeh rv r UN
10. HIP ID 0x define BHA VERSION 0x01 define BHA ACC X LSE H ll define BHA ACC X MOB Dx 3 define BHA ACC Y LSB 0x04 define BHA ACC Y HSB xlb5 define BHA ACC ZC LSE 0x06 detine BHA ACC 4 MSB Ux define BMA TEMP 0x05 Power supply PORTF O The measurement process e Power supply on pull up PORTF 0 e Select device pull down chip select The device needs this falling edge to operate correctly so it must be driven to high before operate the sensor e Read the data registers e Deselect device pull up chip select The sensor is the most complex of all available sensors on mini the operation of the sensor needs to read the manufacturer provided datasheet CAUTION DO NOT WRITE the address space from Ox3B because writing to reserved registers or overwriting the eeprom image can damage the sensor logic make it fully unusable The address space before Ox3B is volatile at boot the content of them are written from eeprom image space The sensor is connected to the USARTO interface of the MCU which can be operate in SPI mode Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 18 H 8000 Sz kesfeh rv r WNUGOMILP Berenyi ut 15 INFORMATIKAI KFT Telefon 36 22 511 130 Fax 36 22 511 131 www unicomp hu Example code Reading registers ninta t BHA GetRegfuints_t address 1 uintB t teBuf 2 address 080 Di uint8 t rxBuf 2 0 0 BHA Select i SPIUSO command amp teBut 0 amp r
11. device may be selected at once SHT21 Temperature and Humidity sensor The measurable data e Temperature e Humidity Interface I2C Address 0x40 The most important command bytes define SHT TEMP HOLD xE3 define SHT HUHID HOLD ZE5 define SHIT TEMP xF3 define SHI HUHID DUxFS5 define SHT W REG D xEB amp define SHT E REG xE define SHT RESET UxFE Power supply PORTF 1 The measurement process e Power supply on pull up PORTF 1 e Sending the desired measure command byte e Collect the data from the sensor Example code The TWI the Atmel calls I C as Two Wire Interface TWI functions must be implemented Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 14 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 char SHT MeasureTenplunsigned char data LEC TWI packet _writelSHT_ ADDRESS SHT TEMP TWI FAIL return TWI_FAIL delay me 100 LEC TWI packet read SHT ADDRESS 3 data TWI FAIL return TWI FAIL return TWI SUCCESS J The received data must to be converted with the manufacturer given coefficients S 16 Z I 2 46 85 175 72 Example code for the conversion int32 t SHT MeasureTempt d unsigned char reBuf 3 0 0 0 uinti amp t adc 0 int32 t ret U ifi SHT Mea
12. ing battery can cause serious injury or fire If the output voltage of the battery falls below 3 5V it should be recharged because the low voltage reduces the battery life The fully charged battery produces 4 2V output voltage In case you need reset condition use the on off switch or use a conductive tool to make contact between the ground GND and reset RST pins on the JTAG connector surface E PD Picture 4 Reseting mini Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 6 H 8000 Sz kesfeh rv r UNIGONIE H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 Periferies 4 e 060 A i Charging indicator MEE Outside power supply re M ps E T i Pr s ie ANC ER UNE TT MEI I M iD 2 DI SM E lt 0 M gt Q lt Q p c A Picture 5 LEDs and the antenna Programming the mote The UCMini devices can be programmed through two interfaces e Direct programming by JTAG interface optional accessory needed e Bootloader programming by USB interface The microcontroller unit MCU of the device shipped with a pre programmed Bootloader firmware which makes possible to program the device simply via an USB connection After startup the Bootloader waits a few seconds for the connection of the PC side bootloader handling software
13. main srec contains 9634 bytes reading on chip flash data 100 1 83s verifying 9634 bytes of flash verified safemode Fuses OK avrdude done Thank you root aUCWSN opt SVN apps RadioCountToLeds build ucmigi Picture 7 AVRDUDE normal execution Users Manual vO 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 9 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 JTAG programming AVR Studio The direct programming is possible only if there is an AVR programming board like AVR Dragon and you need the JTAG connector https sites google com a unicomp hu ucmote kiegeszitok CAUTION The direct programming overwrites the Bootloader section of the program memory after that no way to program the device via USB cable the Bootloader firmware can be uploaded by JTAG and AVR Dragon but it requests special configuration to place it correctly to the bootloader section of the MCU s program memory The direct programming makes debugging and the usage of AVR Studio development environment possible For direct programming you should follow these steps e Connect the AVR Dragon or other compatible JTAG programmer e Run AVR Studio e Plug inthe screws from the opposite side of the battery holder only countersunk screws can be used e
14. ragon found on USB H 1117 Budapest Feh rvari ut 130 Telefon 36 1 456 0998 Fax 36 1 456 0999 The read signature button reads the device signature which must be like this Device and Signature Bytes NIE GAY O01 TAG ID is Oc0A 0103F Signature matches selected device At the Program tab we can write the AVR Studio output files to the device the program code hex the EEPROM content eep and the elf files At the fuses tab we can give the fuse bits they are the configuration settings of the MCU e Brown out detection e On Chip debug e JTAG program e SPI program e Watchdog timer e Preserve EEPROM e Boot size e Boot reset e Clock divider e Clock out e Clock source Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu 12 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Fehervari ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 DO NOT change these settings if you do not know exactly what you are doing Incorrect settings can damage the device or make it totally unusable The default settings with the devices are shipped OxFF 0x98 OxE2 The LockBits tab manages the lock of the memory spaces the change of these settings can make mini unusable too be careful The Advanced tab can be used to calibrate the internal RC oscillator of the MCU The calibration
15. sureTempi rxBuf U TWI SUCCESS 1 adc rxBuf U lt lt 8 rxBuf 1 ret 17572 e faints tjadc B5553b5 ret 4685 return Tet The result is a fixed point signed integer the temperature in Celsius with two decimals The coefficients were multiplied by 100 to avoid using floating point arithmetic in an MCU because its slow and hardly manageable at byte level transfer Users Manual v0 1 UCMote mini 4th of March 2011 ucwsn unicomp hu 15 H 8000 Sz kesfeh rv r WIN ICE OLN LEO H 1117 Budapest Ber nyi ut 15 INFORMATIKAI KFT Feh rv ri ut 130 Telefon 36 22 511 130 Telefon 36 1 456 0998 Fax 36 22 511 131 www unicomp hu Fax 36 1 456 0999 BH1750fvi Ambient light sensor Measureable data e The visible light quantity Interface IPC Address 0x23 The most important command bytes define BH POWEE DOWN x define BH POWER UH 0x01 define BH_RESET Dx define BH CONT H RES 0x10 detine BH_CONT_H2_RES Oxll define BH CONT L RES x13 define BH ONE SHOT H RES 0x20 define BH ONE SHOT H2 RES 0x21 detine BH ONE SHOT L RES x23 Power supply PORTF 1 The measurement process e Power supply on pull up PORTF 1 e Sending the turn on command byte e Sending the desired measure command byte e Collect the data from the sensor Example code char BH Meazure unzigned char mode unsigned char data if BH Ont TWI FAIL return TWI FAIL 1f TMI packet writerBH ADDRESS
16. xBuf 0 2 DNA Dezselect return reBut 1 Writing registers void BHA SetRegfuints t address uint t data ninta t teBut 2 faddress A 0x80 data uintB8 t rxBuf Z 10 07 BHA Select SPIUSO command amp teBut 0 amp reBut 0 2 BHA Dezelect Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu H 1117 Budapest Feh rvari ut 130 Telefon 36 1 456 0998 Fax 36 1 456 0999 19 H 8000 Sz kesfeh rv r UNO Ber nyi t 15 INFORMATIKAI KFT Telefon 36 22 511 130 Fax 36 22 511 131 www unicomp hu M25P16 16Mbit flash memory Interface SPI Chip Select PORTB 4 The most important command bytes define H25_WREN Us define M25 WREDI xl4 define H25 RDID 0xIF define M25 RDSE 0x05 define H25 WESE xl1 define H25 READ Dx 3 define M25 FAST READ 0x06 define H25 PP 0x2 define M25 SE li detine H25 BE Uze define M25 DP Usb define H25 RES xAB Example code Initializing void H25 Int d unsigned char sr HU CS DDR BV CS PIN CS PORT BV CS PIH delay m 100 SPI HasterInit M25 WriteEnable t M25 ReadStatuz amp er Whilefsr l Us i sr Que M25 WriteStatuzs sr delay ms 1 M25 ReadStatuz amp er t Users Manual v0 1 UCMote mini Ath of March 2011 ucwsn unicomp hu H 1117 Budapest Feh rvari ut 130 Telefon 36 1 456 0998 Fax 36 1 456 0999 20 H 8000 Sz kesfeh rv r UNI
Download Pdf Manuals
Related Search
Related Contents
Réalisation du profil UML d`assemblage cible CCM - AIIMS Raipur S.E. International Inspector EXP Copyright © All rights reserved.
Failed to retrieve file