Show Posts
Pages: 1 2 3 [4] 5 6
46  Using Arduino / Displays / multiple devices on the 16bit LCD bus on: March 17, 2013, 05:49:16 am

ok just 2 devices to start

but - has anyone tryed this ?
i'm considering using the 16bits to interface with an PATA/IDE SSD 

47  Using Arduino / Sensors / Re: Using a Sony ILX751A Linear CCD with any arduino. on: March 16, 2013, 03:52:40 am
200ns not 20ns

no way will you will beable to collect full data at full speed of the sensor
your max conversion is 13μs  (from the data sheet of the Mega)
& likely longer (set up & etc)

you could  decimate & get only 31 samples at full sensor speed (must use the built in sample & hold)
better to slow the sensor to the same speed as the sampling ....

the DUE has a max conversion speed of 1us / sample  & i expect to run at about 1/2 that
(full sensor read taking 2048*2us+overhead ~= 200sensor readings a second )



48  Using Arduino / Sensors / Re: Using a Sony ILX751A Linear CCD with any arduino. on: March 15, 2013, 11:11:58 am
i have a ILX551A on order (any day now) looks like a 751 without the shutter function
my experiments withthe upd3799cy are at a stand still (though i belive i know the problem & will revisit it ..)
i am using a Due & have some complications that you do not have (3.3v outputs & Adc input )
though i do have more memory to play with ...
i'll publish some code when its up & running ...


49  Using Arduino / Storage / Re: HDD Read? on: March 13, 2013, 12:10:53 pm
other people read threads - not just the posters

"no" is incorrect
sata needs glue  so does pata
if you have the time, inlination & the gpio bits you could use someting like http://www.addonics.com/products/adsaide.php
to connect a sata  drive-  ide/pata is more straight fwd but requires alot more bits

i've connected CF cards directly to a avrMega (not arduinos) (+ 10 yrs ago ..)
 / software is harder than the wireing / but more fat examples exist now than back then ...

50  Using Arduino / Sensors / Re: trouble sending sensor data to visual basic program on: February 18, 2013, 02:18:04 am
blame windows ...
if you look up "usb disconnecting" you see a raft of issues
 
looks like the "power down scheme" is the thing to blame
51  Products / Arduino Due / Re: Multiple PWM Outputs with Unique Frequencies on: February 10, 2013, 08:10:55 am
manual says:
      mclk/1024*1/255 is the slowest clock  ==   84000000/1024/255==321.69....HZ
 theoreticaly the longest period should be 321.7/65535 =.00491.... hz or 203sec/ pulse...

i dislike the clock setting function / you may have better luck seting it explitistly from the associated values (Find your own dividers & send them to the function )

hook a led(& resistor) to pin 9 & try the code below
Code:
/*
  This example code is in the public domain.
 */

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
#define PWM_CHANNEL_0 0
#define PWM_CHANNEL_4 4
#define PWM_CHANNEL_5 5
#define PWM_CHANNEL_6 6
int period =2;
 
 
 void
startTimer (Tc * tc, uint32_t channel, IRQn_Type irq, uint32_t frequency)
{
  pmc_set_writeprotect (false);
  pmc_enable_periph_clk ((uint32_t) irq);
  TC_Configure (tc, channel,
TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC |
TC_CMR_TCCLKS_TIMER_CLOCK4);
  uint32_t rc =
    (VARIANT_MCK / 128 / frequency) > 2 ? (VARIANT_MCK / 128 / frequency) : 2;
  //128 because we selected TIMER_CLOCK4 above
  TC_SetRA (tc, channel, rc / 2); //50% high, 50% low
  TC_SetRC (tc, channel, rc);
  TC_Start (tc, channel);
  tc->TC_CHANNEL[channel].TC_IER = TC_IER_CPCS;
  tc->TC_CHANNEL[channel].TC_IDR = ~TC_IER_CPCS;
  NVIC_EnableIRQ (irq);
}
//--------------------------------------------------------------------------
// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT); 
   Serial.begin(9600);
  startTimer(TC1, 0, TC3_IRQn, 1);
  //PWM config
  pmc_enable_periph_clk(ID_PWM); 
 
  PWMC_DisableChannel(PWM, PWM_CHANNEL_4); 
 
  PWMC_ConfigureClocks(VARIANT_MCK/1024 /255, 0, VARIANT_MCK);

int ulPin = 9;
              // Setup PWM for this pin
              PIO_Configure(g_APinDescription[ulPin].pPort,
              g_APinDescription[ulPin].ulPinType,
              g_APinDescription[ulPin].ulPin,
              g_APinDescription[ulPin].ulPinConfiguration);
   //***************Channel 4           
   PWMC_ConfigureChannel(
     (Pwm*)     PWM,    // pPwm,
     (uint32_t)    PWM_CHANNEL_4  ,  // ul_channel,
     (uint32_t)    PWM_CMR_CPRE_CLKA  ,  // prescaler,
     (uint32_t)    0  ,  // alignment, 0=left alighned
     (uint32_t)    0  ); // polarity )
    PWMC_SetPeriod(
      (Pwm*) PWM,  //pPwm,
      (uint32_t) PWM_CHANNEL_4,//ul_channel,   
      (uint16_t) period
    );
    PWMC_SetDutyCycle(
      (Pwm*) PWM ,//pPwm,
      (uint32_t) PWM_CHANNEL_4,// ul_channel,
      (uint16_t) period/2 //duty
      );
  PWMC_EnableChannel(
        (Pwm*) PWM,  //pPwm,
        (uint32_t)  PWM_CHANNEL_4// ul_channel
      ) ;
 }


//*******************************************************8
volatile boolean l;

// This function is called every 1 sec.
void TC3_Handler()
{
  // You must do TC_GetStatus to "accept" interrupt
  // As parameters use the first two parameters used in startTimer (TC1, 0 in this case)
  TC_GetStatus(TC1, 0);

  digitalWrite(led, l = !l);
  period < 4 ?  period = 4:period =period  << 1;
  period >65536 ? period = 4 :period;
      PWMC_SetPeriod(
      (Pwm*) PWM,  //pPwm,
      (uint32_t) PWM_CHANNEL_4,//ul_channel,
      (uint16_t) period-1
    );
      PWMC_SetDutyCycle(
      (Pwm*) PWM ,//pPwm,
      (uint32_t) PWM_CHANNEL_4,// ul_channel,
      (uint16_t) PWM->PWM_CH_NUM[4].PWM_CPRD/2 //duty
      );
}

// the loop routine runs over and over again forever:
void loop() {
Serial.println( PWM->PWM_CH_NUM[4].PWM_CPRD);
 
}
52  Using Arduino / Project Guidance / Re: is there a cross ref for Arduino showing capabilities ? on: February 09, 2013, 09:15:54 am
EXCELLENT !! just what i was looking for
53  Using Arduino / Project Guidance / is there a cross ref for Arduino showing capabilities ? on: February 09, 2013, 04:36:00 am
like which has ADC/DAC/PWM/Timers & how many channels ?
how much ram / flash ? .. clock speeds ?
additional periph ?
54  Using Arduino / Motors, Mechanics, and Power / Re: extreem slow/percise stepper control on: February 06, 2013, 10:59:12 am
only need to change direction at the end of a run (1/3 of a revolution,10min or so)

I'm mostly conserned about vibration/ this mech. will be holding optics 
55  Using Arduino / Motors, Mechanics, and Power / Re: extreem slow/percise stepper control on: February 06, 2013, 09:49:43 am
hmmm .. nice ones --
a bit more serching has brought me to
www.servocity.com which has 
 Worm Drive Gearbox (Vertical Shaft) Product # WDG30P
used with a
1 RPM Gear Motor Product # RZ12-3000-1RPM
gets me down to 30min/Rev which is roughly where i want to be ...
(they also have a 0.5 rpm .. 1hour /rev .... might be too long ...
not inexpencive & i'm worried about vibration but may have to try it ....
56  Using Arduino / Motors, Mechanics, and Power / extreem slow/percise stepper control on: February 06, 2013, 04:52:19 am

i would like to drive a stepper on the order of 1000's (5000-10000?) steps per 1/3 of a revolution
(a 400 step / rev .. 1.8deg/step will not work ...)

how easy is it to attach a stepper to attach a stepper to a worm/planetary gearbox ?

or is there a source of dc motors that could be driven at ~ .1 -0.05 RPM  (600sec/rev - 1200sec/rev)

57  Products / Arduino Due / Re: Multiple PWM Outputs with Unique Frequencies on: February 05, 2013, 05:13:30 am
its just a function:

  uint32_t pwm_clk = VARIANT_MCK/2;   //42MHz
  uint16_t pwm_period =  105;           //400kHz==2.5us

  PWMC_ConfigureClocks (pwm_clk, 0, VARIANT_MCK);
  PWMC_SetPeriod (PWM, PWM_CHANNEL_4, pwm_period);

is what i currently  use  ..
if you are trying to get as slow as 1khz  you will likely need to do a VARIANT_MCK/1024 or so
   & adjust your period ..
58  Products / Arduino Due / Re: Multiple PWM Outputs with Unique Frequencies on: February 05, 2013, 02:48:14 am
you have two choices :

A) you can use  PWMC_ConfigureClocks to create two seperate freq clocks
B) you can make 1 clock 38 times slower(faster) than the other ... using  PWMC_SetPeriod
or
C) use timers instead of PWM ...
59  Products / Arduino Due / Re: Arduino DUE PWM and ADC interrupt Triggering on: February 03, 2013, 10:29:01 am
i've been ripping code out from two of the examples in Atmel Studio .. best sources so far
 (adc/pwm example & the synchronous pwm examples)
and re reading the data sheet a couple hundred times ...

i had found that there is a lower limit of time the pwm will work at ..
but don't have the code any more it morphed into other things ...  took some experimentation ..

I'm using the pwm/adc with the PDC  (sampling bursts of 5636 samples in ~15 ms  every 25ms or so )  still adjusting the timing  & have put off futher work till i get new sd card shields 
 
60  Products / Arduino Due / Re: Arduino DUE PWM and ADC interrupt Triggering on: February 03, 2013, 12:34:46 am
check your clk freq..... you might get a surprize

Code:
testPWM_clkA ()
{
  uint32_t clkvalue, clkhz;
  clkvalue = PWM->PWM_CLK;
  if (clkvalue & 0x000000ff)
    {
      clkhz =
(VARIANT_MCK / (1 << ((clkvalue & 0x00000f00) >> 8))) /
(clkvalue & 0x000000ff);
    //print clkhz --------------------------------------//
    }
}
Pages: 1 2 3 [4] 5 6