Show Posts
Pages: [1]
1  Products / Arduino Due / Re: ~10MHz clock generation with the Due on: August 30, 2013, 04:33:06 am
Hi schwingkopf,
Thank for the clear explanation and the document.
It is very helpful
2  Products / Arduino Due / Re: ~10MHz clock generation with the Due on: August 29, 2013, 11:42:36 pm
Hi schwingkopf,

It works like a charm !
Would you mind telling me which documents should I dig up for all those registers and settings?

The code I googled below won't work when I change the value of REG_PWM_CPRD0 from 5000 (works OK), to 500.
Many thanks..


 
Quote
   // Let's say we want to configure PWM channel 0, PWML0 which is on pin34 Due board, and corresponds to the port C.2
    // First the peripheral must be activated instead off the general GPIO
    REG_PIOC_PDR = 4;
    // Moreover it's peripheral B (not A), which means we have to change PIO_ABSR[2]
    REG_PIOC_ABSR = REG_PIOC_ABSR | 4;
    // Now concerning PWM settings...
    // activation of the clock dedicated to PWM peripheral (id36), which is fifth bit of PMC_PCSR1
    REG_PMC_PCER1 = REG_PMC_PCER1 | 16;
    // activation of PWM_ENA register with channel 0
    REG_PWM_ENA = REG_PWM_SR | 1;
    // setting the period (which can take any 16 bit value...)
    REG_PWM_CPRD0 = 500;
    // note : with this 5000 setting, we have thus 1/5000 resol, with a frequency of 16khz, if we use the defaut main clock : that's good
    // Finally, setting the duty cycle to the value you want (between 0 and the period, of course)
    REG_PWM_CDTY0 = 1000;
    // And here we can check at the oscilloscope that we get a nice PWM on pin 34, with a period of 60usec... nice!
3  Products / Arduino Due / Re: ~10MHz clock generation with the Due on: August 29, 2013, 01:02:06 am
I have tried to change PWM_FREQUENCY to different values in "variant.h".

It does work at low freq. (10s of KHz).
However, It won't go above 1MHz. --- the PWM pins does not produce rectangular pulse on a scope.

With a simple error probe, an error message is obtained below.
 Serial.print("PWM_FREQUENCY, ");
 Serial.println(PWM_FREQUENCY);

VARIANT_MCKassertion "frequency < mck" failed: file "../source/pwmc.c", line 107, function: FindClockConfiguration
Exiting with status 1.

I guess I need to set the divider property for a specific pin, that support a high clock.

Any suggestions..?
4  Products / Arduino Due / Re: ~10MHz clock generation with the Due on: August 28, 2013, 12:11:30 am
Hi schwingkopf,

Thanks for the reply.
Could you be more specific for the registers I need to adjust ?
or which .h file should I look into?

http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM
5  Products / Arduino Due / ~10MHz clock generation with the Due on: August 27, 2013, 05:14:51 am
Hi,

I am trying to have ~10-MHz output clock from the Due board for my sensor boards.

Is there way to divide the main clock, and use the divided clock  as an output.
Since the clock for the Due 84 MHz, divide-by 8 will give 10.5MHz (84M/8).
(I guess PWM frequency is much lower than 10MHz.)

I will appreciate any suggestions.
Thanks,
6  Using Arduino / Sensors / Re: Maximum cable lengths for Dht22 and TMP36 Sensors on: September 26, 2012, 01:20:57 am
To be able to set the DC, we need to charge capacitance at the load (including parasitic).

If wire (i.e., cable: signal and gnd wire)  is long, eventually we have pretty large capacitance associate with this;
Even before considering noise induced due to the long wire, we need to use a sensor that is strong (more precisely, strong driving capability).

So, we need to build some sort of driving circuitry to assist sensor to send data.
If digital data go through the cable, we will have robust data against noise.


Datasheet says
Although the TMP3x family of temperature sensors can drive
capacitive loads up to 10,000 pF without oscillation, output
voltage transient response times can be improved by using a
small resistor in series with the output of the temperature
sensor, as shown in Figure 35. As an added benefit, this resistor
forms a low-pass filter with the cable capacitance, which helps
to reduce bandwidth noise. Because the temperature sensor is
likely to be used in environments where the ambient noise level
can be very high, this resistor helps to prevent rectification by
the devices of the high frequency noise. The combination of this
resistor and the supply bypass capacitor offers the best protection.

7  Topics / Science and Measurement / Re: analog outputs on: September 12, 2012, 03:44:29 am
without HW, the answer ,as far as I know, is NO.

but for DC, you can use simple LPF (i.e., RC) to generate DC from PWM.
for AC, you can also play around LPF and PWM; however, I guess, freq. will be limited > several KHz (If you are not using 490Hz default PWM), also the  wave form look rather saw tooth...

A clever summing network might be needed to add two signals.

Nahoona
8  Using Arduino / Installation & Troubleshooting / solved ! Re: Arduino Nano (MEGA328) is recognized on Window7, but not on OS X. on: September 09, 2012, 09:28:10 pm
I have checked FTDI chip under the nano; it is old version. ( much bigger package compared to other arduino boards)

I have installed driver package and worked OK.
9  Using Arduino / Installation & Troubleshooting / Arduino Nano (MEGA328) is recognized on Window7, but not on OS X. on: September 09, 2012, 09:04:15 pm
Hi,

I am using Arduino Nano (MEGA328) for my project.
I have problem using the nano on Max OS X.

The nano is recognized on Window7 (64bit) via COM9; sketch can be downloaded, and works as expected.
However, on Mac OS X, nano is not recognized (no list for the nano, Tools>Serial>Port> ..).
I guess IED on OS X is OK; as other Aruino boards (MEGA 2560, Uno) are working OK on the Mac.

I will appreciate any suggestions.

Nahoona.
Pages: [1]