5

First, we must make sure the "-fno-exceptions" compiler flag is overwritten with "-fexceptions". In addition, we must link a separate library that includes the compiler support functions for stack unwinding. Navigate to C:\Users\<UserName>\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12 and create a new file platform....


5

Why This is a partial answer, for now, mostly with regard to: Why does malloc() never return NULL? So, the Due appears to use Newlib as its libc implementation; that is the systems C (standard and some non-standard) runtime that includes malloc(), or the greater part of malloc() anyway. The Newlib malloc() relies on an sbrk() function which is ...


4

You can write the file in chunks. As suggested by ocrdu in a comment, writing line by line is a good strategy. In order to keep the complexity of the code manageable, I would put the logic of deciding the color of a pixel in its own function, and use another function for managing writing the bitmap. For example: struct Pixel { uint8_t r, g, b; }; // ...


4

Just to warn you, I minimally tested this, but it seems to work. In the Due's linker script there are these relevant lines, containing the named rom section. MEMORY { rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000 /* Flash, 512K */ Below you'll see: SECTIONS { .text : { . = ALIGN(4); _sfixed = .; _sfixed is a symbol they'...


3

I haven't used the Due, but I understand its ADC is rated for 1 MHz sampling. If that's its absolute limit then you can't expect 5 MHz. However, judging by the Unos which I have used, you may be able to push things by limiting the number of bits. This gives a speed boost two ways, by shortening the time the ADC uses to acquire the data, and if you limit ...


3

Yes, they are redundant. They are elements of resistor arrays (multiple resistors in one package) that aren't used. They have just connected all unused pins of those packages to ground. If you want to know why they would have unused elements, it's all to do with optimizing the manufacturing process. If you have, say some 100k arrays elsewhere in your design ...


2

SPI.h library by default only support Master mode, the SPI.begin() will automatically set slave select (ss) pin to HIGH whether you have pinMode(ss, OUTPUT) in your setup() code or not and set the Arduino as an SPI master. This can be see on SPI library source code. As the SPI library does not contain the functionality for slave mode, in order to use Arduino ...


2

The problem is solved. The cable came with my Arduino was charge only , I tried data transfer cable and it worked. This is so dumb. sorry for wasting your time.


2

This library called DueFlashStorage was created by Sebnil and is in the Arduino Library Database Tool! It basically takes the EEPROM functionality and applies it to the Flash storage on the DUE. The only drawback is that the flash memory gets erased every time you upload a new (or new version of a) sketch. For my application that works but for other ...


2

After pressing sw1, the first if works. After releasing sw1 (it's a pushbutton), the line while (digitalRead(sw1) == HIGH); will make the code just sit there forever without continuing with the rest of the code until you press sw1 again, which will be caught by the first if unless you release 'sw1' inhumanly fast. So, once you have pressed and released sw1, ...


2

Two things: Never use delay() inside an ISR. On some systems it may work, but on most it will just block. It's bad practice to have your ISRs run for more time that absolutely needed anyway. You need to read the status register for the TRNG to clear the interrupt flag. You're doing that in your first code sample with if (TRNG->TRNG_ISR == 1) {.


2

You could modify a couple of wooden clothes pegs to act as reverse pliers.


2

I understand some of the Fast Speed Serial options in the Microchip IC cannot be tried in the Arduino Due (such as USBOTG?)?. What I actually need is some Serial Speed close to 2Mbps and a USB Programming Port. What would make you think that? The chip is the chip regardless of what board it's soldered to. You have the native USB and you have all the UART ...


2

The object called lcd that you create inside the setup function is a local variable. It only lives as long as that function is executing - so not very long. It doesn't exist outside that function. The lcd object you have in namespace display on the other hand is a global variable. That one lives as long as your program, which means until you reset your ...


1

I am working with small project same in little bit like what you trying to do.. starting with.. 1- Arduino UNO + OV7670 + 2.4" TFT LCD (I got not clear live Image).. so I made some changes.. 2- Arduino DUE + OV7670 Live Image (still working with, having problem in reading Image) want to compile the result Image (convert it to text) then sending the ...


1

You can use JTAG and probably should. But, it can also be done with bossac if you are very careful. If you're not, you'll end up erasing your flash on your source board. Using bossac This would maybe not be preferred over JTAG because it is probably easier to screw up (see warnings below), but it can be done. I may add some on JTAG programming later, and ...


1

I think I found a workaround. It relies on the fact that on simple program architectures such as the one used on most microcontrollers, the heap grows upwards while the stack grows backwards. const int MIN_FREE_STACK = 512; void* mallocEx(int size) { void* stackPtr = alloca(4); // This returns a pointer to the current bottom of the stack PrintAddress(&...


1

After uploading via Microchip Studio, go to the GPNVM bits section of "device programming" window. Make sure boot mode is set to "boot from flash". Also check that GPNVMBITS register is set to 0x00000002. Then press "program". The sketch you uploaded to the MCU should now work. So it seems what happens is that pressing the erase ...


1

Normally I'd write this a differently, but I've kept in relatively simple just to illustrate the basic idea: struct point { int x; int y; }; const point points_of_interest[] = { { 7, 11}, {23, 17}, {13, 19}, { 3, 5}, {17, 3}, }; void setup() { Serial.begin(9600); } void loop() { delay(4000); Serial.println("\n\n\n"); ...


1

so 1 - yes. the VIN pin has a common trace with the barrel jack, you can verify with a multimeter in continuity/beep mode. ive actually put power out through the barrel jack on a mega. 2- i cant find a clear schematic for the due at the moment, but on the mega the rx/tx pins are also common with the usb pins, thus they are not usable while plugged into usb


1

Silly me forgot to actually upload the code that fixed my issue. The code shown in the question is correct and works as intended.


1

Answer to a 6 years old thread. Hope this will help others :) Looks like you have been using an external power source and only connected the positive core to the pin. If you had an external power source, did you connect the external power source GND to Arduino GND?


1

Looking at the pin configuration, the SPI pins are not in the same location as the UNO. Remove the Shield from Due and use cables to connect to the SPI pins


1

SPI is synchronous. That means that within certain constraints the timing and the width of any part of the signal is irrelevant. What makes you think that it's bad to have a slight variance in the timing, or that the "pause after CS goes LOW!" is "too low"? If you think it's from the timing diagrams, those times are minimum times (generally) and all things ...


1

#include <SoftwareSerial> SoftwareSerial s1(5,6); void setup { s1.begin(9600); s1.setTimeout(50); //sets the timeout of parseint() to 50ms } Please note that lowering the timeout too much can cause errors, i would not go below 10.


1

It depends This may not have been the answer the question was originally asked, but now it appears to be: it depends on which revision of the Due you have. The V03 schematics on the website show a 74LVC1G125DCK part designated IC10 that is being used to translate the 5V TXD signal from the ATMega16u2 (being used as a serial transceiver) to the 3.3V logic ...


Only top voted, non community-wiki answers of a minimum length are eligible