Show Posts
Pages: 1 ... 15 16 [17] 18 19 ... 34
241  Products / Arduino Due / Re: VGA output on: November 19, 2012, 08:28:14 pm
Attached are some screenshots of JLS1's demo programs. Chua oscillator has my modification for colour. Life is Conway's famous 'game' we all know and love.

Cellular automata are explained in Wolfram's 'A New Kind Of Science' chapter 6 - he classifies them into four main types (uniform, structured, random, and complex) and others which are rarer and hard to classify. Attached are two examples, cell2 is complex and cell1 is one that doesn't fit the main types.
242  Products / Arduino Due / Re: VGA output on: November 19, 2012, 07:25:36 pm
Yes, but please not just yet. I am still evaluating better ways of generating the VGA signal, which may be more steady and use less CPU. This might mean changing the pins the signal is output on. However I am not likely to change the format of the framebuffer (240x320 array) so any nice demo code people make now should still work and would be easy to use as example code in a library if authors wanted.

There's also some design decisions to make - if it turns out 640x480 works, should it be a separate library or the same one? Being the same library could make code larger and slower, but might allow mode changes at runtime. Also a library would need standard graphics functions (lines, text, bitmaps) - this is different in an 8bpp mode to a 1bpp mode. And whether to support composite output - 320x200 or 240 8-bit greyscale would be possible. I think that a single library would be more easily maintainable.
243  Products / Arduino Due / Re: VGA output on: November 19, 2012, 04:34:40 pm
Nice :-) It looks great in colour too, change the last line to this:

Code:
  static int c=0;
  fb[120+int(65*4*y)][160+int(65*x)]=(c++)>>12;
244  Using Arduino / Programming Questions / Re: (solved)what's means about "PINB |= 1<<5" on: November 17, 2012, 08:33:06 pm
[That smiley makes me somewhat suspicious that dhenry has written that as a trick question knowing full well the answer, if so I shall attempt to spoil his fun]

What happens depends on what the compiler does. Under some circumstances it can compile PINx |= 1<<y into an SBI instruction, and then clause 13.2.2 of the datasheet applies - only the single pin will be toggled. Otherwise it gets compiled into a ld/ori/st sequence, and the pin gets toggled, other output pins get cleared, and goodness knows what happens to the inputs. This is particularly relevant to the Mega - PINB |= 1<<7 gets compiled to an SBI but PINH |= 1<<7 doesn't.

My advice would be to only use PINx = 1<<y and never to use PINx |= 1<<y unless you really know what you are doing. I don't think it's any faster, at best it is shorter by a couple of bytes.
245  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 07:49:51 pm
Changing SERIAL_BUFFER_SIZE to CDC_SERIAL_BUFFER_SIZE in CDC.cpp has improved things a little - now when the file is sent with a 1ms end-of-line delay it appears to be received correctly. Without the delay though the file is still mostly lost.

Looking at the code, acccept() appears to silently drop characters when the buffer is full - maybe that is where the data is being lost.
246  Products / Arduino Due / Re: Peripheral DMA Controller (PDC) driver for SAM on: November 17, 2012, 06:12:41 pm
Do you have a link for this (or if it is in the Arduino tree, the path)?

And is there a library for the other DMA controller (the AHB one)? I have been trying to program the DMA hardware registers directly and my head just exploded smiley-eek-blue
247  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 06:07:32 pm
The Native port may take longer to initialize.
You may want to try adding this to your stetup().

Code:
void setup() {
  Serial.begin(115200);
  SerialUSB.begin(115200);
  while (!SerialUSB);
}


Thanks, I have added the while line now. However it has made no difference - it still loses data as before. The code works for individual characters - if you type in the terminal window your typing is echoed back. Also, if I set gtkterm to add 20ms of delay after each line, less data gets lost (most lines get echoed mostly correct, but some characters go missing). And the data is lost - I have not seen any data corruption, lines are echoed back correctly or with chunks missing but never garbled data.
248  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 05:12:48 pm
(sorry, I was distracted by Project Euler, back now)

I am getting 10.67Khz on my desktop regardless of what I do, whether running your Python script, my command line (on a disk, ramdisk or /dev/null), on a hub, directly into the computer, with and without the keyboard/mouse plugged in. It does go up (to about 67KHz) when nothing is eating the data. On a Raspberry Pi I got about 4KHz, but that platform is known to have USB issues.

I am running an AMD Phenom II X6 1090T / Gigabyte GA-890 (about 2.5 years old). The computer can run RTL-SDR fine at 3Msps (a USB bandwidth of 6Mbytes/s) - so can the Raspberry Pi. OS is Kubuntu 12.10 64 bit.

The 'loopback' sketch is as follows:
Code:
void setup() {
  Serial.begin(115200);
  SerialUSB.begin(115200);
}
void loop() {
  if(Serial.available()){byte c=Serial.read();Serial.write(c);}
  if(SerialUSB.available()){byte c=SerialUSB.read();SerialUSB.write(c);}
}
Using any terminal program that can send a reasonably large file (I used gtkterm), send something to the Due at 115200. When connected to the programming port, it echos back fine. On the native port, only short sections at the beginning and end get echoed.
249  Products / Arduino Due / Re: Arduino Due - Serial speed? on: November 17, 2012, 12:35:33 pm
Can you have a quick look at the output of dmesg? When I connect my Due it claims to be a high-speed device! If that's true then I guess we're not being limited by the maximum theoretical speed smiley

I tried to do a loopback test - I didn't save the code but it would probably have just been something like:

if(SerialUSB.available()){byte c=SerialUSB.read();SerialUSB.write(c);}

I only got about 230Kbyte/sec into the Due - but most of the data was lost, only short sections near the beginning and end got copied back. Something to look into.

Running your code, I only get 10.67KHz (~330Kbyte/sec)  (I cross checked with stty -F /dev/ttyACM0 raw ; time cat /dev/ttyACM0 >out )
250  Products / Arduino Due / Re: Arduino Due Initialization on: November 16, 2012, 09:32:22 pm
I'd add that from my experiments with timers and VGA, the clock is definitely running at 84MHz by the time setup is called.
251  Products / Arduino Due / Re: Arduino Due Initialization on: November 16, 2012, 04:12:33 pm
I don't know if it is the exact file used, but look at hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/source/system_sam3xa.c - there looks like there is some clock setting code in there.
252  Products / Arduino Due / Re: Due pinout diagram on: November 16, 2012, 08:38:37 am
It is worth knowing about the D10/D77 and D4/D87 duplicates, because each of these duplicates actually refers to a different port and pin. Also people probably ought to know not to set D10 and D77 as output and then have one high and one low, because then there would be an effective short circuit (and similar with D4/D87). Given that the intended audience will probably be more advanced users I'd say it was worth having on the diagram. In any case it might help when we get the inevitable "Where's pin 77?" questions here on the forum.

The D52/D86 duplicate is the same port and pin, I don't know what the reasoning behind it is, maybe it could be removed.
253  Products / Arduino Due / Re: IO Pins status on: November 15, 2012, 08:15:18 pm
If you have written code it would really help us if you posted it here, then we can try running it and see if we get the same result. For 1 I suggest connecting a 1M resistor from an I/O pin to ground and measuring the voltage with a multimeter. For 2, there is a technical way of doing this (by reading PIO_ODSR), but I think it maybe should be a part of digitalRead - I can't remember how digitalRead worked on the Uno, but if it returned the current level of an output pin then we ought to make it work the same way on the Due.
254  Products / Arduino Due / Re: Due pinout diagram on: November 15, 2012, 12:27:51 pm
They are connected to the 16u2, Port B  4,5,6,7 (relative to the diagram, 4 is SE, 5 NE, 6 SW, 7 NW) Remember that they and the ICSP pins work at 5v logic level.
255  Products / Arduino Due / Re: Due pinout diagram on: November 15, 2012, 09:59:23 am
Thanks very much, it is a lot more readable now.

The ports and pins for the TX/RX leds should be swapped. The LEDs themselves are in the correct order (ON,L,TX,RX) but the ports and pins should be in the order D13,D73,D72 ; B.27,A.21,C.30 ; 68,107,103

About D77, what I meant was if you plugged your own LED (and resistor) into D10 on the board, Blink will flash it when led=10 or led=77. It isn't connected to any LED already on the board.

There are some other pin number oddities in arduino_due_x/variant.cpp, for example digitalWrite(79,HIGH) will set both pins 70 and 71 - I don't think it's helpful to add these to the diagram though.
Pages: 1 ... 15 16 [17] 18 19 ... 34