Show Posts
Pages: 1 [2] 3 4 ... 172
16  Using Arduino / Project Guidance / Re: Proportional integral controller with arduino uno on: July 17, 2014, 03:54:20 pm
There is PID library for arduino, have you seen?  Repost your core in # tags, you can find above emoticons line.
17  Products / Arduino Due / Re: No GND or full range on DAC0 on: July 17, 2014, 07:33:40 am
It was mentioned  on this forum many times, that range of the Due DAC is only 1/6 to 5/6 Vcc. You 'd need external circuitry to get it over rail-to-rail.
18  Using Arduino / Project Guidance / Re: Ultrasonic audio amplifier. on: July 16, 2014, 04:53:35 pm
IMHO, both alternative LM386 and TDA7052 are wrong . I would search a low noise amplifier, there are microchip MCP6021/2/4 for example.  Power amplifier may works as a second stage. Old OPA NE5532 or NE5534 can still be competitive.
19  Using Arduino / Project Guidance / Re: ADK shield vs Bluetooth module on: July 16, 2014, 04:42:35 pm
Quote
same thing with  $1 Bluetooth module?
Where you have seen this price? Is it an usb dongle? If so, than you need an USB host shield for arduino, that's driving overall cost up. BT shield for arduino costs 20$ and up, same time the chiepest provide only low speed serial communication, and BT with audio RTime ( 1Mb/s or so ) costs >50$ on SFE. It's all depends on your requirements , speed + time to develop a project / against costs.
20  Products / Arduino Due / Re: Arduino Due Memory Usage on: July 15, 2014, 08:06:25 am
Try to declare Temperature as float, or cast to (float) at calculation time
21  Products / Arduino Due / Re: Due support for AVR (atmel) libraries on: July 14, 2014, 10:01:38 am
http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__pmc__group.html

http://asf.atmel.com/docs/latest/sam3x/html/group__sam__drivers__pmc__group.html#ga3771318f6dcf951222b739363e8960ba

 It's more complicated on ARM, dig into datasheet for datails.
22  Using Arduino / Sensors / Re: Arduino DUE analog read broken? on: July 11, 2014, 09:57:06 am
It's strange, here is my test results:
Quote
In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4090
   In-0: 0
   In-1: 4090
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4090
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4091
   In-0: 0
   In-1: 4091
And code:
Code:
int val1;
int val2;

void setup(){
  Serial.begin(115200);
  while (!Serial);
  analogReadResolution(12);
}

void loop(){
  Serial.print("\n\tIn-0: ");
  val1 = analogRead(A0);
  Serial.print(val1);

  delay(1000);
  Serial.print("\n\tIn-1: ");
  val2 = analogRead(A1);
  Serial.print(val2);
  delay(1000);
}
Have you made a mistake in connection? 3.3V and 5V dangerously close.
23  Using Arduino / Project Guidance / Re: Arduino Uno with Android on: July 06, 2014, 06:02:44 am
Start from here: http://www.circuitsathome.com/ 

Declaimer:   
24  Using Arduino / Project Guidance / Re: Android & Usb Host Shield (or board) on: July 06, 2014, 05:48:49 am
You are welcome.
Can't say about ADK, but web page - http://arduino.cc/en/Main/ArduinoBoardMegaADK?from=Main.ArduinoBoardADK
says:
Quote
NB: Because the MEGA ADK is a USB Host, the phone will attempt to draw power from it when it needs to charge. When the ADK is powered over USB, 500mA total is available for the phone and board.The external power regulator can supply up to 1500mA. 750mA is available for the phone and MEGA ADK board. An additional 750mA is allocated for any actuators and sensors attached to the board. A power supply must be capable of providing 1.5A to use this much current.

 Moreover, fuse F2 on electrical drawings for phone USB connector is only 500 mA, so my feeling that would make same troubles.
It looks like, design was made for small android devices, 4.3' or less. As bigger screen more demanding for current, 7' and especially 9'-10' - devices are not gonna be compatible.
25  Using Arduino / Project Guidance / Re: Arduino reading AC voltage on: July 04, 2014, 05:05:42 pm
Atmel's application note AVR465 explains all your questions. Google for it.
26  Using Arduino / Project Guidance / Re: Android & Usb Host Shield (or board) on: July 04, 2014, 09:10:39 am
Yes, you can connect UNO and android via shield. The problem I had, is that arduino can't supply enough current, so whenever my tablet see usb connected its try to switch in charging mode and demand 2 A or so ( tablet's own power supply rated 2 A ). And if usb voltage goes down below 4.4V usb interrupted. I was able to solve issue only by soldering separate +5V power plug on the USB shield, in prototyping area, and connecting external source.
27  Products / Arduino Due / Re: Fastest serial communication and ADC conversion with Due on: June 21, 2014, 04:36:30 pm
Try this:
http://forum.arduino.cc/index.php?topic=225204.0

Library example code includes variable sampling over DMA. Default 48 kHz, I 'd be interested if you try it on 250 kHz. 
28  Products / Arduino Due / Re: Fastest serial communication and ADC conversion with Due on: June 20, 2014, 07:33:23 pm
Quote
In the case of the SPI I might also consider DMA, but it is not as critical as the ADC when I try to sample at 500 Khz (that was the main reason for starting this post).
Your initial post says 20 kHz, now it's 500 ?  You didn't answer the question what you gonna to do with  a samples.
 Have you clear picture about an application on PC side, that would receive a data with such high  rate?  Last time I tried to send a byte stream from my UNO to Android 4.2 via USB host shield, and to my great surprise it was not an UNO that can't catch up, dumb android with stupidest java can't  get a data w/o loosing a frame or two whenever speed goes above 5 ksps !!!!    So I give up.
29  Products / Arduino Due / Re: Fastest serial communication and ADC conversion with Due on: June 20, 2014, 04:39:39 pm
Quote
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?

Quote
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?
30  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:

Quote
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:
Code:
void Adafruit_ILI9340::writecommand(uint8_t c) {
/*
  CLEAR_BIT(dcport, dcpinmask);
  CLEAR_BIT(clkport, clkpinmask);
  CLEAR_BIT(csport, cspinmask);
  spiwrite(c);
  SET_BIT(csport, cspinmask);
*/
  CLEAR_BIT(dcport, dcpinmask);
  CLEAR_BIT(csport, cspinmask);
  spiwrite(c);
  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);
  spiwrite(c);
  SET_BIT(csport, cspinmask);
*/
  CLEAR_BIT(csport, cspinmask);
  spiwrite(c);
  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:
Code:
SPI_ConfigureNPCS(spi, ch, mode[ch] | SPI_CSR_SCBR(divider[ch]) | SPI_CSR_DLYBCT(0));

Results:
Quote
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
Done!

 
Pages: 1 [2] 3 4 ... 172