Show Posts
Pages: [1] 2 3 ... 166
1  Products / Arduino Due / Re: ADC and Timer relationship in DUE on: April 18, 2014, 01:01:58 pm
I use an example from this thread:
http://forum.arduino.cc/index.php?topic=205096.0
and it's working
2  Products / Arduino Due / Re: A General to question to registers --Arduino Due on: April 16, 2014, 06:17:56 pm
Just set SWTRG, don't worry about address. Here is an example:
Code:
void tmr_setup ()
{
  pmc_enable_periph_clk(TC_INTERFACE_ID + 0 *3 + 0); // clock the TC0 channel 0

  TcChannel * t = &(TC0->TC_CHANNEL)[0] ;            // pointer to TC0 registers for its channel 0
  t->TC_CCR = TC_CCR_CLKDIS ;                        // disable internal clocking while setup regs
  t->TC_IDR = 0xFFFFFFFF ;                           // disable interrupts
  t->TC_SR ;                                         // read int status reg to clear pending
  t->TC_CMR = TC_CMR_TCCLKS_TIMER_CLOCK1 |           // use TCLK1 (prescale by 2, = 42MHz)
              TC_CMR_WAVE |                          // waveform mode
              TC_CMR_WAVSEL_UP_RC |                  // count-up PWM using RC as threshold
              TC_CMR_EEVT_XC0 |     // Set external events from XC0 (this setup TIOB as output)
              TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_CLEAR |
              TC_CMR_BCPB_CLEAR | TC_CMR_BCPC_CLEAR ;
 
  t->TC_RC = TMR_CNTR;              // counter resets on RC, so sets period in terms of 42MHz clock
  t->TC_RA = TMR_CNTR /2;           // roughly square wave
  t->TC_CMR = (t->TC_CMR & 0xFFF0FFFF) | TC_CMR_ACPA_CLEAR | TC_CMR_ACPC_SET ;  // set clear and set from RA and RC compares
  t->TC_CCR = TC_CCR_CLKEN | TC_CCR_SWTRG ;  // re-enable local clocking and switch to hardware trigger source. 
}
3  Products / Arduino Due / Re: ADC and Timer relationship in DUE on: April 16, 2014, 06:02:54 pm
Quote
And this one does stuck as well...
How do you know?  I can't see any debug  messages, or timestamps, loop is just empty.
4  Products / Arduino Due / Re: Anyone using CMSIS? How to get started? on: April 11, 2014, 11:32:50 am
My impression is that CMSIS was designed to be a layer (API ?) for cortex, but it looks like not all chip makers follow this idea.
I've seen STM, and arduino alike Maple (STM32F103)  project was   completely build on CMSIS, but it isn't the case for Atmel.
He invented ASF, and I don't know where you find ADC implementation in CMSIS, but what I can see in my arduino installation, all hardware API calling to ASF, leaving to CMSIS just headers and registers definition, as already noted above.
http://asf.atmel.com/docs/latest/architecture.html
http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__adc__group.html
5  Using Arduino / Motors, Mechanics, and Power / Re: making a device for generating different vibration frequencies on: April 11, 2014, 08:47:59 am
Quote
'precision microdrives' 8mm vitration motor (ie a small button that vibrates)
To drive a motor use analogWrite. Value 'd define average current, and consequently speed of rotation or RPM, and freq = 60 X RPM.(Hz)
6  Using Arduino / Microcontrollers / Re: Arduino DUE and ADC configuration on: April 10, 2014, 11:10:34 am
Try this:
http://forum.arduino.cc/index.php?topic=205096.0

Here is an example sampling ADC over DMA (PDC):
http://forum.arduino.cc/index.php?topic=225204.0
7  Using Arduino / Project Guidance / Re: High frequency measuring on: April 09, 2014, 05:50:26 pm
I think software library is more simple solution than hardware filtering. Software counter could give 1 Hz resolution, or even 0.1 Hz over 10 sec counting interval, the same time 1-st order RC could only provide about 10% change in voltage level, and it boils down to 100 ADC tick over 100 kHz, or 1 kHz resolution or so, which is 10 000 times worse
8  Using Arduino / Project Guidance / Re: High frequency measuring on: April 09, 2014, 05:41:17 pm
Complicate than what?
9  Using Arduino / Project Guidance / Re: High frequency measuring on: April 09, 2014, 05:30:43 pm
There is a library: 
http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/
10  Products / Arduino Due / Re: Using the 32 bit Timer Clock with the Arduino Due on: April 08, 2014, 08:19:16 pm
Due has a DAC, may be you don't need PWM approximation after all
11  Using Arduino / General Electronics / Re: High Sensitivity Vibration Sensor Using Arduino on: April 08, 2014, 05:59:36 pm
It's a mistake on a paper drawings
12  Using Arduino / Audio / Re: Eliminating Relay pop in preamp/TVR on: April 08, 2014, 04:56:09 pm
Do you have a circuits schematics?
13  Using Arduino / Sensors / Re: Using a pair of accelerometers instead of a single analog flex sensor ? on: April 08, 2014, 04:49:29 pm
1. Yes.
2.
Quote
Could I benefit from using also the measurements of acceleration on y and z axes in some way? Should I change the acceleration range (currently it's set to 4G)? Up to which point is the temporal synchronization of the measurement on the two sensors important ? Should I smooth the data on time using median/lowpass filter before comparing ?????
a. I don't think so.
b. Range has to be correlated to max acceleration, there must not be a "clipping". Can you dump a data to buffer or PC, to verify clipping issue?
c. Obviously data has to be synchronous.
d. All depends on temporal scale : how fast do you need update rate ? 1 / 100 / 1000 per second?
How you sample a data, can you be sure freq. rate is exact? Filtering doesn't make sense w/o strictly defined two conditions.
14  Using Arduino / Audio / Re: Continulusly recording audio in fixed size buffer on: April 07, 2014, 09:16:48 pm
There is a topic, sampling analog at 100 ksps , on this forum, you may try to search. Data is stored to SD, AFAIR.
15  Using Arduino / Audio / Re: Continulusly recording audio in fixed size buffer on: April 07, 2014, 05:22:14 pm
They called it ring buffer. Unlikely you can store 6 sec. of decent quality audio - not enough memory. What you have?
Pages: [1] 2 3 ... 166