Show Posts
Pages: 1 2 [3] 4 5 ... 172
31  Products / Arduino Due / Re: Fastest serial communication and ADC conversion with Due on: June 20, 2014, 04:39:39 pm
My idea is to use a buffer for the ADC using DMA, and besides it, one timer interruption with my sample frequency, so that every time I get the interruption from the timer, I read the last value that was wrote on the buffer. Is that right?
It's just a non-sense. Using a buffer with DMA is a requirements. You are not using interruption from the timer, timer starts ADC conversion w/o invoking CPU, DMA plays role to transfer conversion results to memory, again not bothering CPU. Do you mean last valueS - plural?

In this case, I have one extra doubt. If I just want to have a buffer with the last 8 values of the ADC, do I need to set up also the "next_buffer" of the DMA? Or could I use a single buffer in a circular configuration?
Here I'm not completely sure, but my understanding. that is a way how SAM3X wired, it needs two buffer to set up uninterruptable sampling subroutine. Last time I did experiment to supply same name of the buffer  as current and next one - doesn't work out, sampling stops after buffer was filled up.  What you gonna to do with 8 samples of data?
32  Products / Arduino Due / Re: Due SPI slow (especially for specific pin (DueExtendedSPI)) on: June 18, 2014, 06:34:29 pm
I get better results, tweaking a library:

Benchmark                Time (microseconds)
Screen fill              1272712
Text                     83679
Lines                    770077
Horiz/Vert Lines         103624
Rectangles (outline)     66612
Rectangles (filled)      2642734
Circles (filled)         408815
Circles (outline)        335850
Triangles (outline)      244213
Triangles (filled)       860011
Rounded rects (outline)  147955
Rounded rects (filled)   2890392

Improvement mostly due to optimization in  this 2 functions:
void Adafruit_ILI9340::writecommand(uint8_t c) {
  CLEAR_BIT(dcport, dcpinmask);
  CLEAR_BIT(clkport, clkpinmask);
  CLEAR_BIT(csport, cspinmask);
  SET_BIT(csport, cspinmask);
  CLEAR_BIT(dcport, dcpinmask);
  CLEAR_BIT(csport, cspinmask);
  SET_BIT(dcport,  dcpinmask);
  SET_BIT(csport, cspinmask);

void Adafruit_ILI9340::writedata(uint8_t c) {
  SET_BIT(dcport,  dcpinmask);
  CLEAR_BIT(clkport, clkpinmask);
  CLEAR_BIT(csport, cspinmask);
  SET_BIT(csport, cspinmask);
  CLEAR_BIT(csport, cspinmask);
  SET_BIT(csport, cspinmask);

 As you can see, rearranging lines in first  "write commands" allows reduce two calls: SET_BIT and CLEAR_BIT.
SPI set to 42 MHz, AFAIR.

Next logical step, is to change a SPI mode:
SPI_ConfigureNPCS(spi, ch, mode[ch] | SPI_CSR_SCBR(divider[ch]) | SPI_CSR_DLYBCT(0));

Adafruit 2.2" SPI TFT Test!
Benchmark                Time (microseconds)
Screen fill              1254578
Text                     90745
Lines                    853465
Horiz/Vert Lines         103581
Rectangles (outline)     66857
Rectangles (filled)      2605449
Circles (filled)         422465
Circles (outline)        372370
Triangles (outline)      270660
Triangles (filled)       871669
Rounded rects (outline)  158699
Rounded rects (filled)   2858402

33  Using Arduino / General Electronics / Re: Darlington (or better) driver with 7 inputs/outputs on: June 18, 2014, 04:51:45 pm
Note that the UDN2980A series (dual in-line
package) and UDN2980LW series (small-outline
IC package) are electrically identical and share a
common terminal number assignment.
Recommended for high-side switching applications that benefit from
separate logic and load grounds, these devices encompass load supply
voltages to 50 V and output currents to -500 mA. These 8-channel source
drivers are useful for interfacing between low-level logic and high-current
loads. Typical loads include relays, solenoids, lamps, stepper and/or servo
motors, print hammers, and LEDs.
All devices may be used with 5 V logic systems — TTL, Schottky TTL,
DTL, and 5 V CMOS. The UDN2981A, UDN2982A, and A2982SLW are
electrically interchangeable, will withstand a maximum output off voltage of
50 V, and operate to a minimum of 5 V. All devices in this series integrate
input current limiting resistors and output transient suppression diodes, and
are activated by an active high input.
34  Using Arduino / Project Guidance / Re: Distance measuring on: June 06, 2014, 09:59:30 pm
Are you thinking RF speed, or reaction time in the receiver?   
Receiver, they build around super regenerative type.
  Yes I expect there to be some variation in the time from receive to transmit, however by counting to 1024, or whatever, there would be plenty of time averaging to minimize that variable. 
The problem with cheap receiver that error via AM is correlated to distance, and consequently averaging can't cure. Though, a lot would depends on your expectation of the accuracy.
  At this time I am thinking about using straight CW type of signals, without using any modulation.
In order to calculate a propagation time, you have to switch on/off CW, and this is a modulation, 1-bit, simplest form.
No ideas or help on your bent pipe project.
They call "bend pipe" when RF system consist of receiver antenna, mixer + amplifier , and transmitter antenna. So basicaly RF fly in, make U-turn (180 degree - bend pipe) and fly back to origin.
35  Using Arduino / Project Guidance / Re: Distance measuring on: June 06, 2014, 07:04:16 pm
I'd try the cheap ones, like
The problem I can see, is variation in amplitude of RF with distance would affect round trip time. Not ready to estimate how big error it may cause. 

FM module would be nice to try, but unfortunately I can't find any on a market. Digital RFM12 and RFM22 seems to me have no direct correlation between time of arriving RF and time when it shows up at outputs, as there is internal shift logic, and amount of delay time it introduces not reflected in documentation. May works over big numbers of oversampling.

Analog module I linked above also could benefit using oversampling, statistical processing, to get down range error less than 0.3 metr.

I'm also thinking to build a mixer (low price) , that can create bended pipe for RF, receiving 433, than mixing up with 118 to get back 315.  Far end would not have a delay at all in this case, just traveling time
36  Using Arduino / Project Guidance / Re: Distance measuring on: June 06, 2014, 05:07:35 pm
37  Using Arduino / General Electronics / Re: Problem reading random noise generator on: May 31, 2014, 08:00:24 pm
140 to 890 on the ADC's scale
Thats exactly what I'd expect from 3Vpp input. Full range 5 Vpp.
38  Using Arduino / Project Guidance / Re: RF or RFID Vehicle Tracking System on: May 22, 2014, 08:20:52 am
Similar thread
reply #9 & #11
39  Using Arduino / Audio / Re: Arduino + MIC + FFT + WS2811 Leds Spectrum analyzer on: May 21, 2014, 11:29:51 pm
You may try this library, example include NeoPixel 8x5 shield (adafruit).  Sparkfun electret mic board connected to analog 0.
40  Using Arduino / Project Guidance / Re: Arduino object seeking device. on: May 20, 2014, 11:41:51 am
Build with AtMega1284:
41  Products / Arduino Due / Re: generate 10Khz triangle waveform on: May 20, 2014, 08:05:00 am
If you modify Sinewave[2][] data, you can try a code from this page:
42  Using Arduino / Project Guidance / Re: Arduino object seeking device. on: May 20, 2014, 12:12:02 am
43  Topics / Science and Measurement / Re: Filter library test on: May 18, 2014, 04:43:33 pm
Perhaps, TimerOne library could help.
44  Topics / Science and Measurement / Re: Filter library test on: May 18, 2014, 10:11:46 am
But also there nearly the same problem: 220Hz doesn’t pass but a frequency of 306Hz?!
Probably, your sampling rate isn't defined at 5 kHz, but vary above the spec.
Do you have a scope? If not, i could suggest to use your PC as a freq. meter, set one digital pin as output, and drive it high/low in the loop. Than using audacity or something else, use PC sound card to measure freq. Don't forget to attenuate a voltage from the pin with resistive divider, and put a DC blocking cap
45  Topics / Science and Measurement / Re: Filter library test on: May 16, 2014, 11:56:37 am
What do you think, it’s principally possible to use a filter and generate sine-waves simultaneously?
Sure, it's possible. 500 Hz is quite low freq.,
I did some tests and the filter didn’t work anymore.
It happenes, when two subfunction interfere with each other.
Pages: 1 2 [3] 4 5 ... 172