Show Posts
Pages: [1] 2 3 ... 41
1  Products / Arduino Due / Re: About Serial.print() function for DUE on: July 24, 2014, 06:53:38 am
You should use the native port, not the programming port, if you care about speed.
2  Products / Arduino Due / Re: Arduino Due only: Wrong initialisation of SPI SS pins causes failure on: July 24, 2014, 06:41:15 am
I was not able to reproduce the problem you've described.  I would have to conclude your hardware is faulty.

Your report of this problem is also lacking detail.  If you really expect anyone to help, perhaps you could document the problem using an oscilloscope screenshot, as I have just done.
3  Products / Arduino Due / Re: Arduino Due only: Wrong initialisation of SPI SS pins causes failure on: July 24, 2014, 06:35:22 am
I just tested with Arduino 1.5.7 and Arduino Due & Arduino Ethernet Shield, with my oscilloscope connected to pin 10.  I loaded File > Examples > Ethernet > WebClient and clicked upload.

Here is the pin 10 waveform as the board starts up.



I do not see 1.65 volts.  The voltage appears to be floating at approx 2.5 volts before the sketch begins.  While the program is running, it's usually 3.3V and goes to 0 volts while using the ethernet chip.

Here's a zoom in view during the time while the sketch is transferring data.

4  Products / Arduino Due / Re: Arduino Due only: Wrong initialisation of SPI SS pins causes failure on: July 23, 2014, 03:02:11 pm
Can you please post a small but complete, ready-to-run program which demonstrates the problem?
5  Using Arduino / Programming Questions / Re: The Software serial multple serial test example does not compile on: July 01, 2014, 06:59:05 pm
R_AVR_13_PCREL is a known bug in the avr-gcc linker.
6  Using Arduino / Programming Questions / Re: How to clear serial buffer? on: July 01, 2014, 06:57:49 pm
It might be worth noting that the WIN32 API used on Windows, and the POSIX API used on Macintosh and Linux, use the same functions to access data from ordinary files and serial devices.

In fact, all use the term "read".  On WIN32, the function is ReadFile(), and on Mac and Linux it's simply read().
7  Using Arduino / Programming Questions / Re: How to clear serial buffer? on: July 01, 2014, 07:11:54 am
Do you know of any good, inexpensive, preferably parallel (or serial if there are no parallel ones) LIFO chips?

I've never seen a dedicated LIFO chip.  They may exist, but if so, I'm not aware of any.

Of course, FIFO chips are still made.

http://www.cypress.com/fifos/

Quote
How scared should a novice solderer be about putting pins on a Teensy, whether 2.0 or 3.1?

For the pins on the outside edges, it's pretty much the same as soldering pins to any breakout board, for Arduino Mini or Nano.  Usually you'd put the pins into a breadboard or socket, so the ends are held at the correct spacing, while you solder to the circuit board.

A version of Teensy is sold with the pins already soldered, mainly for use with solderless breadboards.  If you don't have a soldering iron, building on a solderless breadboard with that version is definitely the way to go.

Quote
Especially the 3.1, I'd love some kind of combo breakout and ZIF that would contact all the pins!
Hey, we're not all hardware heads!

I'm reluctant to write much more specifically about Teensy here on Arduino's forum.  There's a forum for Teensy.  In fact, here's a recent thread about this.

http://forum.pjrc.com/threads/26071-Using-all-Teensy3-x-pins-with-a-socket

Let's talk about anything specific to Teensy, which isn't somehow related to Arduino's products, on the PJRC forum.
8  Using Arduino / Programming Questions / Re: How to clear serial buffer? on: July 01, 2014, 06:08:25 am
I also think of last-in first-out stacks when I see "push" and "pop".  Using those terms for non-stack buffers seems terribly confusing to me.
9  Using Arduino / Interfacing w/ Software on the Computer / Re: C++ serial communication too slow on: June 30, 2014, 01:44:00 pm
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365467%28v=vs.85%29.aspx
10  Using Arduino / Programming Questions / Re: How to clear serial buffer? on: June 30, 2014, 07:15:28 am
Quote
That's when you have the capability to push.
How do you supposed data gets into the serial buffer?

The Serial receive code is designed for only the main program to remove data from the buffer, and only the interrupt routine to add data to the buffer.  If you add code in the non-interrupt context which modifies the "head" index, which today is only written by the interrupt context, you'd disturb the careful design which avoids extra overhead of disabling interrupts while manipulating the buffer, and head and tail index.

Certainly it's possible to put data back into the input buffer, but not a simple addition.  As soon as you write to the head index from the main program, or to the tail index in interrupt context, the entire design needs to be carefully analyzed and/or guarded by interrupt disable.  In a best case scenario, such a seemingly simple feature would cost quite a bit of extra code/overhead.  In a worst case scenario, such a chance could easily introduce difficult-to-troubleshoot bugs to the serial code.
11  Using Arduino / Programming Questions / Re: Detecting available space in Serial transmit buffer on: June 30, 2014, 05:19:26 am
Not sure how the interrupt priority is related?

I must confess, I haven't analyzed all possible ways calling these functions while executing at different interrupt priorities might impact things.

Quote
If room() is called from non-interrupt context, any interrupt can interrupt it, right?

Yes, of course, any interrupt can interrupt it.

So far, this design is basically the same as all the rest of the hardware serial code, which assumes one of the index variables is only advanced by the main program and the other only advanced by interrupt context.

If there are cases where this needs to be improved, I'm certainly willing to improve the code.

Quote
However, in the teensy code, it seems there are some #ifs to allow head and tail to be uint16_t. In that case, AFAIU on AVR all reads and writes to them should be done with interrupts disabled to prevent the variable changing halfway through a read

Teensy uses two completely separate core libraries, one for AVR and one for ARM.

The AVR version only supports uint8_t for head and tail.

The ARM version uses uint8_t if the buffer size is under 256 bytes, or uint16_t if the buffer is larger.  On ARM, reading 8, 16 or 32 bits uses a single instruction.
12  Using Arduino / Programming Questions / Re: Detecting available space in Serial transmit buffer on: June 29, 2014, 01:03:59 pm
Since posting this, I realized it's off by one.  Here's the corrected code.

https://github.com/PaulStoffregen/cores/blob/master/teensy3/serial1.c#L219

None of the rest of this code disables interrupts when reading head and tail.  My understanding is it's safe because one index is only written by the interrupt, the other only written by the main program, both strictly increasing.  Apparently this is a well established programming pattern, but I couldn't quickly turn a reference about it.

Maybe the whole thing should have interrupts enabled and disabled while manipulating the buffers and head/tail index?

This particular file is targeting only 32 bit ARM.  There's a separate file for 8 bit AVR, and at this point I'm not sure if I'm really interested in adding anything to the old AVR stuff.

On 32 bit ARM, there's no point returning smaller uint16_t or uint8_t types.  In fact, using smaller than 32 bit can even sometimes cause slower code.  Function args and outputs are always passed in 32 bit registers, even if they're just 8 or 16 bits, because ARM simply doesn't have any 8 or 16 bit registers.  Using a smaller type can sometimes force the compiler to insert a logical AND to truncate the data to the specified size.

13  Using Arduino / Programming Questions / Re: Detecting available space in Serial transmit buffer on: June 29, 2014, 03:09:52 am
If anyone is still watching this old thread, I'd really like some feedback about my attempt to implement this on Teensy.

https://github.com/PaulStoffregen/cores/commit/d289954223bd4febe3eeddb168992ee948b018b6

It seems to be working, but I'm still not 100% confident this code is correct, especially for the case of the buffer being entirely full.
14  Products / Arduino Due / Re: CapacitiveSensorDue not working on: June 14, 2014, 07:40:01 pm
I recently worked on this library, adding non-AVR support with optimized register writes.

https://github.com/PaulStoffregen/CapacitiveSensor

This version supports Arduino Due with optimized I/O, like the original library did only for AVR.
15  Products / Arduino Due / Re: i2cdevlib + MS561101BA + due on: June 12, 2014, 08:59:26 am
Here's a copy of FreeIMU where I've applied fixes for bugs people have discovered when used on Teensy 3.0 and 3.1.

https://github.com/PaulStoffregen/FreeIMU

I have no idea if this will solve your problems on Arduino Due, but since Teensy 3.1 & Due use similar ARM Cortex-M chips, it might be worth a try?
Pages: [1] 2 3 ... 41