Friday 25 October 2013

Solution for NesC ADC Reading Program in TinyOS

Issues  &  Solution


Configuraton for the TinyOS-2.1.1[Solution for the Reading data from ADC ]

Same configuration we can apply to lower Versions of TinyOS If Following error occurs while doing the Programs
  1. SensirionSht11C.nc Component not found.
/opt/tinyos-2.1.1/tos/sensorboards/mda300/SensirionSht11C.nc:53: component SensirionSht11ReaderP not found
In file included from /opt/tinyos-2.1.1/tos/sensorboards/mda300/SensirionSht11C.nc:60,
from /opt/tinyos-2.1.1/tos/sensorboards/mda300/SensorMDA300CA.nc:94,

Status :Issues Solved
By Adding the Sensiron Component from /chips/sh11/ in to the /sensorboard/mda300/ Sensor Directory
  1. Cannot Find Int3_interrupt
In component `HplSensirionSht11C':
/opt/tinyos-2.1.1/tos/sensorboards/mda300/HplSensirionSht11C.nc:69: cannot find `Int3_Interrupt'
In component `MDA3XXDigOutputC':
/opt/tinyos-2.1.1/tos/sensorboards/mda300/MDA3XXDigOutputC.nc:63: cannot find `Int0_Interrupt'

Satus:Issues Solved

https://www.millennium.berkeley.edu/pipermail/tinyos-2-commits/2010-May/009672.html

Add the this component of the top componet

lines no
  

components HplAtm128GeneralIOC as Pins, MicaBusP;
+ components HplAtm128InterruptC

Edit the file /platform/mica/MicaBusC

lines no --- 32,45 ----
/* Added for Error Resolving Int3_Interrupt */
/* INT lines used as interrupt source */
/******************************************/
+ interface GpioInterrupt as IntO_Interrupt;
+ interface GpioInterrupt as Int1_Interrupt;
+ interface GpioInterrupt as Int2_Interrupt;
+ interface GpioInterrupt as Int3_Interrupt;

+ interface GeneralIO as UART_CLK;
+ interface GeneralIO as UART_RXD;
+ interface GeneralIO as UART_TXD;
/*******************************************/

Add this also in implemenation Section for UART enable configuration file for Atm128 Component
lines no

+   UART_CLK = Pins.PortD5;
+   UART_RXD = Pins.PortD2;
+   UART_TXD = Pins.PortD3;
+ 
+   components new Atm128GpioInterruptC() as Atm128GpioInterrupt0C;
+   Atm128GpioInterrupt0C.Atm128Interrupt->HplAtm128InterruptC.Int4;
+   Int0_Interrupt=Atm128GpioInterrupt0C.Interrupt;
+ 
+   components new Atm128GpioInterruptC() as Atm128GpioInterrupt1C;
+   Atm128GpioInterrupt1C.Atm128Interrupt->HplAtm128InterruptC.Int5;
+   Int1_Interrupt=Atm128GpioInterrupt1C.Interrupt;
+ 
+   components new Atm128GpioInterruptC() as Atm128GpioInterrupt2C;
+   Atm128GpioInterrupt2C.Atm128Interrupt->HplAtm128InterruptC.Int6;
+   Int2_Interrupt=Atm128GpioInterrupt2C.Interrupt;
+ 
+   components new Atm128GpioInterruptC() as Atm128GpioInterrupt3C;
+   Atm128GpioInterrupt3C.Atm128Interrupt->HplAtm128InterruptC.Int7;
+   Int3_Interrupt=Atm128GpioInterrupt3C.Interrupt;

Add the following line in to the Atm128GpioInterruptC file
line  no --- 40,43 ----
    }
  
+   default async event void Interrupt.fired() { 
  1. DIOP readDone event is not connected
In component `DIOP':
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc: In function `DigOutput.readyToRead':
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:84: DigChannel_0.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:86: DigChannel_1.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:88: DigChannel_2.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:90: DigChannel_3.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:92: DigChannel_4.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:94: DigChannel_5.readDone not connected
/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:96: Read_DIO.readDone not connected
make: *** [exe0] Error 1

Satus:Issues Solved

Edit the DIOP.nc file by comment the the signal readDone event [ It will disable the implicit the signal raise for I2C by enabling the digital pin connected to Atmega 128 Microcontroller to MDA 300 CA Data Aqusition Board]
By adding the 1 KOhm Resistance to the VCC - CLK and VCC to Data will enable the I2C on the Board
event void DigOutput.readyToRead (){
uint8_t channel;
channel = call DigOutput.read();
channel = channel | 0xC0; //to consider only the least significant 6 bit. 0xC0 = 1100 0000

if (channel == 0xFE){
// signal DigChannel_0.readDone(SUCCESS, channel);
}else if (channel == 0xFD){
// signal DigChannel_1.readDone(SUCCESS, channel);
}else if (channel == 0xFB){
// signal DigChannel_2.readDone(SUCCESS, channel);
}else if (channel == 0xF7){
// signal DigChannel_3.readDone(SUCCESS, channel);
}else if (channel == 0xEF){
// signal DigChannel_4.readDone(SUCCESS, channel);
}else if (channel == 0xDF){
// signal DigChannel_5.readDone(SUCCESS, channel);
}else if (channel == 0xFF){
// signal Read_DIO.readDone(SUCCESS, channel);
}
}

No comments:

Post a Comment