[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter SixAxisTransmitterM.nc, 1.3, 1.4

steve ayer ayer1 at users.sourceforge.net
Fri Sep 14 12:11:55 PDT 2007


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25559

Modified Files:
	SixAxisTransmitterM.nc 
Log Message:

major bug fix:  dma transfers were in repeat block mode, yet the a/d
conversion feeding it was in single conversion mode.  code now sets
dma to single transfer mode.

also added a dma0.begintransfer() to the sampletimer event to keep
things rolling.

thanks to stephen linder for digging this one out.

Index: SixAxisTransmitterM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/SixAxisTransmitter/SixAxisTransmitterM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SixAxisTransmitterM.nc	13 Jun 2007 18:31:08 -0000	1.3
--- SixAxisTransmitterM.nc	14 Sep 2007 19:11:53 -0000	1.4
***************
*** 95,99 ****
  
      // we want block transfer, repeated
!     DMA0CTL = DMADT_5 + DMADSTINCR_3 + DMASRCINCR_3;
  
    }
--- 95,99 ----
  
      // we want block transfer, repeated
!     DMA0CTL = DMADT_1 + DMADSTINCR_3 + DMASRCINCR_3;
  
    }
***************
*** 104,110 ****
      atomic{
        CLR_FLAG(ADC12CTL1, ADC12SSEL_3);         // clr clk from smclk
!       SET_FLAG(ADC12CTL1, ADC12SSEL_3);         // clk from aclk
        
!       SET_FLAG(ADC12CTL1, ADC12DIV_7);         // with ekg, _3 is about 180hz, _2 ~= 210 hz, _1 ~= 320 hz, _0 ~= 640 hz
        // sample and hold time four adc12clk cycles
        SET_FLAG(ADC12CTL0, SHT0_0);   
--- 104,110 ----
      atomic{
        CLR_FLAG(ADC12CTL1, ADC12SSEL_3);         // clr clk from smclk
!       SET_FLAG(ADC12CTL1, ADC12SSEL_3);        
        
!       SET_FLAG(ADC12CTL1, ADC12DIV_7);         
        // sample and hold time four adc12clk cycles
        SET_FLAG(ADC12CTL0, SHT0_0);   
***************
*** 332,335 ****
--- 332,336 ----
  
    event result_t sampleTimer.fired() {
+     call DMA0.beginTransfer();
      call DMA0.ADCbeginConversion();
      return SUCCESS;



More information about the Tinyos-contrib-commits mailing list