Show Posts
|
|
Pages: 1 2 [3] 4 5 ... 30
|
|
31
|
Products / Arduino Due / Re: Timer Interrupts on Due
|
on: April 15, 2013, 12:18:10 pm
|
Thanks guys for this mission. I got 1 MHz working on the DUE, but I found that digitalWrite is slow. So it messes up my tc_handler. Doesn't leave it anymore. And I need to write in the ISR, maximum control every microsecond. You have a fast alternative for digitalWrite ?
digitalWriteDirect() will work faster than 1MHz, although it may be a challenge to get it that fast in an interrupt due to overhead. Try it anyway. inline void digitalWriteDirect(int pin, boolean val){ if(val) g_APinDescription[pin].pPort -> PIO_SODR = g_APinDescription[pin].ulPin; else g_APinDescription[pin].pPort -> PIO_CODR = g_APinDescription[pin].ulPin; }
inline int digitalReadDirect(int pin){ return !!(g_APinDescription[pin].pPort -> PIO_PDSR & g_APinDescription[pin].ulPin); }
|
|
|
|
|
32
|
Products / Arduino Due / Re: linking with libarm_cortexM3l_math.a ?
|
on: April 14, 2013, 06:34:01 am
|
|
Only platform.txt needs to be changed, as per cmaglie's post.
Just to reiterate what I said before - I've now had this modification for 2 months and have used the IDE heavily and have had absolutely no problems or incompatibilities at all with sketches not using the library. I would recommend this change to be included in the next IDE release.
|
|
|
|
|
34
|
Products / Arduino Due / Re: VGA library - now with TV output
|
on: April 11, 2013, 06:16:30 am
|
First of all, really great work! I tried the DrawingTestPal example of your library with the Arduino Ide 1.5.2 on my Arduino Due, but it show me this error : In file included from DrawingTestPAL.ino:1: C:\Users\andrea\Desktop\Andrea\Arduino\arduino-1.5.2\libraries\VGA/VGA.h: In function 'void _v_digitalWriteDirect(int, boolean)': C:\Users\andrea\Desktop\Andrea\Arduino\arduino-1.5.2\libraries\VGA/VGA.h:49: error: 'g_APinDescription' was not declared in this scope C:\Users\andrea\Desktop\Andrea\Arduino\arduino-1.5.2\libraries\VGA/VGA.h:50: error: 'g_APinDescription' was not declared in this scope
Make sure you have selected Arduino Due in the Tools/Board menu - that's the main cause of that particular error message.
|
|
|
|
|
35
|
Products / Arduino Due / Re: Arduino 1.5 Beta for Raspberry Pi?
|
on: April 09, 2013, 06:56:27 pm
|
|
Unfortunately it does not look as if it will be viable. The IDE runs far too slowly to be usable, and compilation takes far too long. I don't have a correctly working toolchain yet, and compiling one takes many hours per attempt - I have not found the magic combination of options which works.
|
|
|
|
|
36
|
Products / Arduino Due / Re: Arduino 1.5 Beta for Raspberry Pi?
|
on: April 09, 2013, 11:45:07 am
|
|
I like the idea, not just because of both being ARM based but also both being 3.3V. I might have a go at trying to get it to compile.
I don't think Java will be a problem, since Arduino already runs on the Pi. It may be more of a problem getting a compiler / toolchain set up. Even though both use ARM the Raspberry Pi uses gnueabi and the Due needs none-eabi (ie a compiler designed to make binaries to run on a bare chip without an OS). I think this has already been done. bossa is quite a simple program so should be easy to compile on the Pi.
|
|
|
|
|
37
|
Products / Arduino Due / Re: The frequency slows down continously but takes time to spped up!
|
on: April 09, 2013, 06:22:38 am
|
|
You need to reset the counter whenever you change the period. What can go wrong is, if you shorten the period, the counter might have already gone past the new period value, and then it won't trigger the interrupt until it has counted all the way to 0xFFFFFFFF, wrapped around to 0 and got to the new period value - which is why it takes a while to speed up.
The line REG_TC0_CCR0=0b101; restarts the counter. You need to put it just after REG_TC0_RC0 = incomingValue*1000000;
|
|
|
|
|
38
|
Using Arduino / Installation & Troubleshooting / Re: Problem interfacing with Uno from kubuntu cli
|
on: April 08, 2013, 08:37:02 pm
|
I use a fd to get around this (google bash fd for more information) For example: void setup() { Serial.begin(9600); Serial.println("Enter a digit between 0 and 9 for squaring"); } void loop() { while(!Serial.available()); int i=Serial.read()-'0'; if(i>=0 && i<=9)Serial.println(i*i); }
~/arduino$ stty -F /dev/ttyACM0 sane raw -echo 9600 ~/arduino$ exec 6<>/dev/ttyACM0 ~/arduino$ line <&6 Enter a digit between 0 and 9 for squaring ~/arduino$ echo 3 >&6 ~/arduino$ line <&6 9 ~/arduino$ echo 8 >&6 ~/arduino$ line <&6 64
It can be unreliable at shell prompts but works much better in scripts.
|
|
|
|
|
43
|
Products / Arduino Due / Re: print from flash memory broken on DUE?
|
on: April 04, 2013, 02:37:28 pm
|
Well I guess one way of testing it is to try printing a string over 96K long... void setup() { Serial.begin(1200); }
void loop() { Serial.print( "\n" "ACT I\n" "SCENE I. A desert place.\n" "\n" " Thunder and lightning. Enter three Witches \n" "\n" "First Witch\n" "\n" " When shall we three meet again\n" " In thunder, lightning, or in rain?\n" "\n" "Second Witch\n" "\n" " When the hurlyburly's done,\n" " When the battle's lost and won.\n" "\n" "Third Witch\n" "\n" " That will be ere the set of sun.\n" "\n"
... over 100K later....
"MALCOLM\n" "\n" " We shall not spend a large expense of time\n" " Before we reckon with your several loves,\n" " And make us even with you. My thanes and kinsmen,\n" " Henceforth be earls, the first that ever Scotland\n" " In such an honour named. What's more to do,\n" " Which would be planted newly with the time,\n" " As calling home our exiled friends abroad\n" " That fled the snares of watchful tyranny;\n" " Producing forth the cruel ministers\n" " Of this dead butcher and his fiend-like queen,\n" " Who, as 'tis thought, by self and violent hands\n" " Took off her life; this, and what needful else\n" " That calls upon us, by the grace of Grace,\n" " We will perform in measure, time and place:\n" " So, thanks to all at once and to each one,\n" " Whom we invite to see us crown'd at Scone.\n" "\n" " Flourish. Exeunt\n"
); }
Believe it or not, it works 
|
|
|
|
|
44
|
Products / Arduino Due / Re: DUE losing program while on 3.3V battery
|
on: April 03, 2013, 08:21:30 pm
|
Looking quickly through the datasheet it may be possible to disable the auto-erase functionality in software. If you understand low-level coding the idea would be to enable PIO on port C pin 0, set it as an output and drive it low. However that will make it impossible to upload new code to the board. If I have read the data sheet correctly you should be able to erase the chip by unplugging the board and holding down the erase button whilst plugging the board back in. Try it at your own risk 
|
|
|
|
|