Show Posts
Pages: [1] 2 3 ... 782
1  Products / Arduino Due / Re: Reading the state of the ICSP-1 pin on: July 30, 2014, 10:15:27 am
digitalRead (MISO) ??  Think that will work
2  Products / Arduino Due / Re: Sample square wave frequency with Arduino Due on: July 30, 2014, 10:09:58 am
And of course it can't measure frequency accurately because you are polling without
filtering on edges.

You need to wait for an edge to get its timestamp, not just observe the value is high
now and was low last time getFrequency() was called, because that could be a while
back (due to printing results or whatever else loop() does).

Interrupts much more accurate. They won't miss edges due to the sketch being
busy either.

BTW

1/(duration/1000000) == 1000000/duration
3  Products / Arduino Due / Re: Sending Multiple Bytes with SPI.Transfer using Arduino Due on: July 30, 2014, 10:03:21 am
You need to read this:
http://arduino.cc/en/Reference/DueExtendedSPI

In particular the use of SPI_CONTINUE
4  Products / Arduino Due / Re: error compiling on: July 30, 2014, 10:00:50 am
In preparation for a due board I purchased, I installed the ide version 1.5.7. It installed without errors. However, when attempting to compile any code I get a message error compiling.  Attached are the output from the compile with verbose option selected.

Not certain but that doesn't seem to have any errors - what was the sketch (in full, post it in
code tags) and the error messages (in full, unedited)?
5  Products / Arduino Due / Re: Due PWM Dimming Resolution Only 8 bit? on: July 30, 2014, 09:46:35 am
So a little quick check - seems to work at 12 bit resolution with these definitions
replacing the old ones in variant.h:

Code:
/*
 * PWM
 */
#define PWM_INTERFACE PWM
#define PWM_INTERFACE_ID ID_PWM
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 0xFFF  // changed from 255
#define PWM_MIN_DUTY_CYCLE 0
#define PWM_RESOLUTION 12  // changed from 8

/*
 * TC
 */
#define TC_INTERFACE        TC0
#define TC_INTERFACE_ID     ID_TC0
#define TC_FREQUENCY        1000
#define TC_MAX_DUTY_CYCLE   0xFFF  // changed from 255
#define TC_MIN_DUTY_CYCLE   0
#define TC_RESOLUTION     12  // changed from 8


Path to variant.h:
<installdir>/hardware/arduino/sam/variants/arduino_due_x/variant.h
6  Products / Arduino Due / Re: Due PWM Dimming Resolution Only 8 bit? on: July 30, 2014, 09:06:20 am
The comments in the code make it clear that the call is meant to apply to analogWrite
as well as analogRead....  In fact it will work if the PWM_RESOLUTION #define is
changed to 12 as the code calls mapResolution() for PWM and TC pins as well as
for DACC.

Of course changing the PWM_RESOLUTION would also need changes to some of the
other parameters to avoid slowing down default PWM frequency.
7  Products / Arduino Due / Re: some questions on due pwm on: July 30, 2014, 09:02:32 am
If you describe exactly what you are trying to achieve it might help find a solution
(ie say what you want, not just how you think it can be done....)
8  Products / Arduino Due / Re: Due PWM Dimming Resolution Only 8 bit? on: July 30, 2014, 08:56:10 am
I was a bit glib in my previous posting - it seems the Due implementation still
has only 8-bit PWM_RESOLUTION
(PWM_RESOLUTION is #defined in variant.h, btw - you could tailor you
distribution by changing it - I believe I've commented on here before that
is ought to be a variable, not a #define, anyway).

I'd also check to see if there's a good PWM library for the Due - its entirely possible
someone has created one.
9  Products / Arduino Due / Re: Arduino Due: 16-bit int and others data types on: July 30, 2014, 08:53:01 am
Also remember than when C was first designed it was relatively common to run on
machines where bytes were 6 bits and word length was 36...  Nowadays everything
is in octets (octet = "8-bit byte", more precise than just saying byte) so we never see
"int6_t" - which is just as well!
10  Products / Arduino Due / Re: SPI interrupt on: July 30, 2014, 08:48:24 am
The Due processor is about 50 times more complex than the ATmega328, some
study of the (very large) datasheet is necessary to come to terms with it, allow a
few days for studying it I reckon.

I'd read the general intro, then the SPI section, then read the Arduino runtime
code for its SPI handling (which uses libsam, which you also have source code for).
Find and study examples too.
11  Using Arduino / General Electronics / Re: WS2811 LED Analog Strip Controller on: July 30, 2014, 08:36:58 am
That chip has constant current sinking outputs (analog), not logic (digital) outputs,
so it will not produce PWM signals.

Just drive the MOSFETs from PWM pins.  Use 180 ohm gate resistors to protect the Arduino.

12  Using Arduino / Motors, Mechanics, and Power / Re: programming stepper motors on: July 30, 2014, 07:49:21 am
Any particular turntable? If so details are useful.
Any deep reason why you want a stepper motor?
13  Using Arduino / Motors, Mechanics, and Power / Re: MOSFETs for PWM of high current/voltage - Does order in series matter? on: July 30, 2014, 07:46:10 am
BTW where is the high current and high voltage?
14  Using Arduino / Motors, Mechanics, and Power / Re: Switched Reluctance Motor Control using Arduino on: July 30, 2014, 07:43:10 am
Do I get a prize for spotting the explosive device hidden in that circuit, namely C19
a 25V electrolytic powered from the 170V rail?

That circuit is drawn back to front and upside down, alas, rather hard to follow...
15  Using Arduino / Motors, Mechanics, and Power / Re: MOSFETs for PWM of high current/voltage - Does order in series matter? on: July 30, 2014, 07:36:36 am

Is there any particular reason why I never see the MOSFET between the cathode of the LED and Vin?  Assuming a Vin of 12V, and a 5V logic signal, should I expect the MOSFET to not conduct from drain to source?  Is this why the switch is typically located between the anode and ground, after the load does its business?

Seems trivial, though I never thought the sequence of components in series mattered. 

To conduct the gate needs to be +5V w.r.t. source. When the MOSFET is on the drain
and source are at the same voltage (nearly).  If the drain was connected to +12V you'd
need +17V on the gate, rather than +5V.   This is called source-follower configuration
and is not normally used for switching (*) due to lack of a 17V supply!

(*) Actually it is commonly used for switching in most industrial applications, but this
requires use of bootstrapped floating gate-drivers that work at the same potential as
the source, which itself is pinging up and down as the device switches.  Doing this
allows an H-bridge or 3-phase inverter circuit to use all n-channel devices which are
superior to p-channel devices (about 3 times better carrier mobility).
Pages: [1] 2 3 ... 782