Show Posts
Pages: 1 2 3 [4] 5 6 ... 15
46  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 04, 2012, 02:02:07 pm
Thanks great. Working fine here.

Just left to sort out my own warning message now smiley

Iain
47  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 04, 2012, 11:20:06 am
Ah. They must have changed the default. Did a fresh install when I downloaded v1.0.

Iain
48  Using Arduino / Displays / Re: GLCD library version 3 on: January 04, 2012, 11:15:22 am
Bill,

The way my system is set up, I've 390us to do any single blocking operation. Writing a single character is fine (< 130us) and wrapping is OK (< 230us) but if a scroll is required it's much larger than 390us.

I'd like to disable the scrolling but I can't see any way to do this.

I'd also like my strings to truncate if they're longer than the current line rather than wrapping onto the next line and potentially causing a costly scroll. Just to make things more awkward I'm using a variable pitch font.

Iain
49  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 04, 2012, 10:24:31 am
I'm using the Arduino v1.0 IDE.

arduino-1.0\libraries\SerialPort\SerialPort.cpp: In member function 'uint16_t SerialRingBuffer::put(uint8_t*, size_t)':
arduino-1.0\libraries\SerialPort\SerialPort.cpp:131: warning: comparison between signed and unsigned integer expressions

Iain
50  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 04, 2012, 10:04:46 am
Excellent news.

BTW any chance of fixing the signed / unsigned warning in SerialPort.cpp in the next release? I hate seeing the odd red message disappear by, not knowing if it's mine or not.

Iain
51  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 03, 2012, 05:34:09 pm
sixeyes,

I was already playing with designs for flash strings. 

I plan to add:
Code:
/** Write a flash string */
size_t SerialPort::write(const __FlashStringHelper *);

/** Write a flash string and CF/LF */
size_t SerialPort::writeln(const __FlashStringHelper *);

Excellent. Just what I need.

Quote
I already found a bug in my new read(uint8_t*, size_t) function.

Line 423 of SerialPort.h should be:
Code:
      p += rxRingBuf[PortNumber].get(p, limit - p);

Ah. Not used the read() stuff yet. Patched my code. Thanks

Iain
52  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 03, 2012, 04:00:29 pm
I posted a new beta, SerialPortBeta20120103.zip, here http://code.google.com/p/beta-lib/downloads/list
I've tried it out and it is faster when using RAM strings, but to save space most of my debug messages are coming from flash memory.
Could I request 1 additional function that takes a __FlashStringHelper as an argument can copies it directly into the ring buffer?
At present I'm copying from __FlashStringHelper to a RAM buffer and then passing on to SerialPort. Still faster than before but could be faster still.

Not seen any bugs yet.

Iain
53  Development / Other Software Development / Re: Where to find windows tools? on: January 03, 2012, 01:32:26 pm
From Arduino v1.0 running

gcc.exe --version

gcc.exe (WinAVR 20081205) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Looks like it's 3 years old and counting...

Iain
54  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 03, 2012, 09:01:52 am
There is no point in limiting buffers to a power of two.  You don't need a divide to maintain the index for a ring buffer.
Fair enough. If there's no reason for it, don't bother. I seen to remember the old HardwareSerial did do divides but my memory might be failing me.

Iain
55  Using Arduino / Programming Questions / Re: Losing incoming data from a serial port. on: January 03, 2012, 06:05:13 am
Yes, you're right. The GPS unit isn't transmistting much data, but when it comes it comes fast.

...

Code:
_bytes_avail<18>,bytes_read<96>
_bytes_avail<70>,bytes_read<120>


If you poll at 5 mS intervals a GPS transmitting at 57600bps (5760 bytes per second), you won't get those figures. 1/5760 is a byte every 0.1736 mS, so to get 70 bytes would take 12.15 mS, not 5 mS.
But the debug he's producing will seriously compromise his test results. It's going to take quite a while to produce the debug messages. Perhaps he should follow Paul's example and store the results in an array and display that when finished.

Iain
56  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 03, 2012, 05:46:06 am
That sounds like a reasonable limitation. I've only used powers of 2 so far. And you can enforce this easily using the pre-processor.

Iain
57  Using Arduino / Programming Questions / Re: Losing incoming data from a serial port. on: January 02, 2012, 01:01:41 pm
In Arduino v1.0 the receive buffer is 64 bytes and the new transmit buffer is also 64 bytes for an Uno / Mega.
58  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 02, 2012, 07:27:21 am
The core Arduino based serial port code is only included in your sketch if you actually use it. For example:
Code:
void setup()
{
    Serial.begin(9600);
    Serial.println("Using Arduino supplied HardwareSerial");
}

void loop()
{
}

So if you've copied the SerialPort folder from the zip file into your Libraries folder (So you have Arduino-1.0\libraries\SerialPort\SerialPort.h and Arduino-1.0\libraries\SerialPort\SerialPort.cpp) you can write the following code instead

Code:
#include <SerialPort.h>

SerialPort<0, 32, 256> port;

void setup()
{
    port.begin(9600);
    port.println("Using SerialPort class");
}

void loop()
{
}

Just remember to do the following and you should be alright:

  • Include <SerialPort.h>
  • Declare new Serial port including its parameters
  • Initialise (call begin()) and use the new serial port (NOT Serial)

The configuration of the serial port looks odd to anyone not familiar with C++ templates, but it's easy to explain. The first parameter inside the angle brackets is the serial port number. Unless you've got a board with more than one serial port (e.g. Arduino Mega) this will always be 0. The second parameter is the size of the receive buffer in bytes and the third is the size of the transmit buffer in bytes.

You can ignore the stuff about editing SerialPort.h. You'll only need this is you're short of flash memory at which point you can come back and ask more questions.

If you do by chance refer to both the new SerialPort and HardwareSerial in the same sketch you'll get some error messages about duplicate interrupt vectors.

Hope that helps.

Iain
59  Development / Other Software Development / Re: An alternative Serial Library for Arduino 1.0 on: January 01, 2012, 05:08:34 pm
That's awesome. Your work has already helped me out. The debug messages I was using in my actual program were taking 1500us to produce. With your SerialPort and some serious tuning I was able to get this down to 320us which is inside my 390us limit.

Thanks for your efforts.

Iain
60  Using Arduino / Displays / Re: GLCD library version 3 on: January 01, 2012, 02:30:02 pm
Move this:
Code:
static FontCallback FontRead;               // font callback shared across all instances
from gText.h to the top of gText.cpp. Put it just above:
Code:
/*
 * Experimental defines
 */
at line 35
Thanks. That's great. Job done.

Quote
There are a few others, I'll also get rid of.
I'm not sure I can get rid of the warnings about the progmem stuff used by the fonts though.
Not seeing any others here at present.

Iain
Pages: 1 2 3 [4] 5 6 ... 15