Show Posts
Pages: [1] 2
1  Products / Arduino Due / Re: some questions on due pwm on: July 22, 2014, 06:09:58 am
The SAM3X is a true PWM powerhouse. I can get 14 PWM channels at high speed (dozens of kHz) with 8 bit. No problem. The highest speed you can get at 8 bit is 330 kHz afaik. And pulses can be extremely short (1 MCU clockcycle if necessary). You can increase frequency if you sacrifice PWM resolution. 7 bit will yield 660 kHz, for instance.

You can do PWM with the true PWM pins, but also with the TC pins. Complementary PWM is very powerful. Deadtime can be set independently basically creating twice the amount of independent PWM, although resolution gets halved. But then you have at least 22 independent PWMs. Maybe more.. but I forgot if TC could also do complementary mode (i thought it could). What I know for sure is that TC uses half the MCU clock.. so only 42 MHz instead of 84.

PWMH7 is only present on the SAM3 217 pin package and the DUE only has 144 pins. And PIO_PC20B_PWMH4 is not even connected. to the pins.. oh well. still enough of these buggers.

That a pin starts reducing very slowly smells like it's being set to high impedance to me. That means it's configured as an input, not as an output. You might have to call PIO_Configure() for that pin.. Also, it's probably better to configure the duty cycle from a TC / PWM interrupt as this can be done completely bumpless.

The SAM3X is an amazing piece of hardware.

2  Products / Arduino Due / Re: Problems making project for Sam3X8E‏ on: July 22, 2014, 05:30:55 am
hhhm, that tutorial looks interesting. the error message looks pretty cryptic and looks like gcc  messed up when printing it..
i recently did the makefile thing myself, totally isolated from this tutorial posted here. it's not as generalized as what i see here, but easier to understand (no fiddling script) and might work for you when you adapt it to use your own code.
some info:
3  Products / Arduino Due / My life with the Due, part due on: July 12, 2014, 06:03:43 am
hi guys,

updated my blog a little bit with recent findings on the Due/SAM3X. for instance, DMAC, PDC, digitalWrite replacement, and how to get 30 PWM pins..

have fun!

4  Products / Arduino Due / Re: How to use more than 3 slaves on Due spi? on: July 12, 2014, 06:01:22 am
It is possible using different pins, but settings like word size, speed, etc will not be automatically changed when chip select is changed. this only works on pins 4,10,52. like others say, if you'd like to have more of this, you can hook up a demux like Palliser says.

5  Products / Arduino Due / Re: DUE ethernet performance on W5200 with SPI and SPI+DMA on: July 05, 2014, 05:38:17 am
great code! i will be using this to read from an adc at 50kHz.. yielding about 1.2 Mbps traffic up and 600 kbps down. which should be peanuts compared to what you guys are doing with ethernet.

one question: can we use multiple dma streams at the same time? i see the code may need to be a bit extended? can the sam3x do this at all? typically, in a complex embedded system, there are multiple devices on the same SPI bus..

6  Using Arduino / Displays / Re: LCD display with ILI9341 driver on Arduino on: June 23, 2014, 03:52:45 pm
ah, nevermind. read the ILI9341 datasheet and it seems there's no hardware assistance whatsoever except vertical scrolling, haha smiley
7  Using Arduino / Displays / Re: LCD display with ILI9341 driver on Arduino on: June 23, 2014, 03:20:53 pm
i didn't read this entire thread, as it's huge.. but from what i scanned and the code i saw, this ILI9341 is completely software-driven. meaning all pixels have to be pushed from the MCU side.. does anyone know if it can do more? it would be ideal if it had some hardware for doing a simple block-copy, without having to pump pixels from the MCU..
8  Products / Arduino Due / Re: Change the Sine wave frequency on: May 27, 2014, 01:46:38 pm
i see you ditched the arduino analogWrite() and so on.. congrats. i'm also using less and less of that.

if you want something else as 2,4,6,8, etc (integers) try looking up "fixed point arithmetic". just reserve a couple of bits behind the comma. this may be a nice place to start..
9  Products / Arduino Due / Re: Our Life With The Due on: April 11, 2014, 02:57:11 am
Hhmm.. I thought I did use the pinMode().. Will check again, when I get round to it..
10  Products / Arduino Due / Our Life With The Due on: April 10, 2014, 03:21:46 pm
Just a little blog post dealing with our recent Arduino Due experiences..

Hope you enjoy it. And if there is any expert that can tell me why GPIO pin 53 is always high?
11  Products / Arduino Due / Re: INPUT_PULLUP on: March 15, 2014, 08:52:36 am
reading this i gather that a bigger pull-up resistor might lower the registered voltage and hence it might not be seen as high anymore. it's logical.

..but then it might be nice to consider using external pull-up resistors on the DUE..
12  Products / Arduino Due / INPUT_PULLUP on: March 15, 2014, 08:16:38 am
A project I made (originally for AVR based Arduino) uses INPUT_PULLUP mode on some of the digital pins to read out of tactile switch. On the UNO, this works fine. On the DUE, it's unstable somehow. When the switch is open and my hand comes close to the wire there's a square wave instead of a constant value.

I read that the DUE the pull-up resistors have higher impedance, but how can that cause this?

13  Products / Arduino Due / Re: DUE PWM Frequency on: March 14, 2014, 03:15:26 pm
the AVR has so-called "accurate PWM mode" to facilitate this h-bridge control (pulse is always centered around a unique determined point in the PWM period). it seems the Due's SAM has what Atmel call "complementary" mode. this is only available on the four PWM pins. the other pins are called TC (Timer/Counter) and do not feature complementary mode.

btw. . changing TC_FREQUENCY does not  mess up delay() or micros(). i'm a happy man smiley

14  Products / Arduino Due / Re: DUE PWM Frequency on: March 14, 2014, 01:34:24 pm
in variant.h:
change the line:

#define TC_FREQUENCY        1000


#define TC_FREQUENCY        300000

and as said previously:

#define PWM_FREQUENCY           1000


#define PWM_FREQUENCY           300000

the frequency doesn't have to match exactly. it's governed by the mother clock divided by the pwm resolution (256 steps) divided by a power of two. the max would be 84 MHz / 256 = 328.125 kHz.

hope that clears things up. there could be more elegant ways and i still have to test what this does to micros() and delay().. on AVR-based Arduino that issue exists.
15  Products / Arduino Due / Re: DUE PWM Frequency on: March 14, 2014, 09:48:24 am
to change the PWM frequency of all pins.. that means also the ones not in range 6,7,8,9.. you should change also TC_FREQUENCY in variant.h.

this works perfectly. i get a nice 330 kHz period for all pins now.
Pages: [1] 2