Show Posts
Pages: 1 [2] 3 4 ... 25
16  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 27, 2014, 04:38:09 pm
Some news on the latest updates.

1. Improved time/clock handling
Additional support for time/clock compare and handling of wrap-around (RTC/Watchdog/Alarm/Activity).

2. Improved portability
UART, Pin Change Interrupt and External Interrupt class have been restructured to improve porting. The hardware resource symbols are used instead of board symbols.

3. Code quality
The Cosa class header file have been restructure to improve readability. Protected and private definitions are moved last in the class definition. The Arduino build setting (platform.txt) suppressing compiler warnings has been removed and all compiler issues removed.

4. AVR GNU tool chain (AVR_8_bit_GNU_Toolchain_3.4.3)
The AVR GCC 4.8.1 is now supported. Previous version (4.3.X) will be deprecated. The new compiler fixes a number of issues (PROGMEM and PSTR warnings, etc).

5. Support for ATmega256rfr2 (Pinoccio)

17  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 20, 2014, 01:34:42 am
TWI bus frequency setting per device.
On the same wires? If so can that work?
No, not really as a device will a lower speed could misinterpret the signalling at higher speed and not "disconnect" correctly (i.e. START/ACK). The use case is simply moving the bus frequency setting from compile time to run time. This makes the frequency setting possible in the sketch instead of the TWI class.

18  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 19, 2014, 06:39:41 pm
Some news on the latest update of Cosa.

1. Support for Microduino processor modules; Core, Core32u4 and Core+ (ATmega644, 64K PROM, 4K SRAM).

2. TWI bus frequency setting per device.

3. CDC speed improvement.

19  Using Arduino / Microcontrollers / Re: Arduino @ 8MHz instead of 16MHz on: March 18, 2014, 02:36:49 pm
Why change any hardware (crystal, intern clock, etc)? Why not simply use the prescaling function in ATmega328? See chap. 8.11 System Clock Prescaler. In Cosa the following member function is available.
Power::clock_prescale(uint8_t factor)
  if (factor > 8) factor = 8;
  synchronized {
    CLKPR = (1 << CLKPCE);
    CLKPR = factor;

And then there are all the Power Management functions. Below is a link to a Blink sketch that uses three threads (each with 60 byte environment) that runs on ATtiny85 and uses only 10-15 uA when the LED is off.

Another Cosa low power example sketch is:
This sketch demonstrates a number of different strategies to reduce power.


20  Development / Other Software Development / Re: Fast hashing library on: March 18, 2014, 01:54:59 pm
Did you do your benchmark against AVR standard CRC funtions or just quoting the original post?

What was the performance of this implementation?
And how did you tweak it for the AVR processor?

The original implementation and benchmark was at 1.6 GHz i386 architecture, And "Data is time in seconds taken to hash a random buffer of 256 bytes 5 million times"

How long time would this take on an Arduino ;-)?

I believe the incremental version is more useful for a micro-controller with only 2-4 Kbyte of memory. And there are some tweaks to be done to improve performance on an 8-bit architecture.

Here is an interesting link:

21  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 17, 2014, 02:45:48 pm
Gets better all the time.
Thanks! Hope your Quub project is progressing well. Have been following some of the latest changes.

With the size of Cosa (50 KLOC/100+ classes) the Arduino build is starting to become a bottle-neck. More traditional build methods will become necessary. The initial build takes "time" and having pre-compiled libraries for different boards could remove this "delay". This could also allow delivering object code when source code is not "open".

Cosa is approaching the initial project goal; a rapid prototyping environment for Internet-of-Thing devices. With the support for HTTP, SNMP, MQTT and ThingSpeak there is essential support for getting sensor data to a server/cloud and commands back to the device over Internet.

I will be going back to the Wireless device drivers and improve security (encryption), robustness and reliability (acknowledgement/retransmission) and add support for additional wireless device (e.g Wifi, GSM). 

22  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 16, 2014, 06:14:18 pm
Some news on the latest development in Cosa.

1. ThingSpeak Channel and TalkBack example sketch
An example sketch that allows the TalkBack commands LED_ON/OFF, SENSOR_ON/OFF, PING/PONG together with post of sensor data to a channel. The command SENSOR_ON will enable post of sensor data (DHT11) to a channel. The command LED_ON/OFF controls a led. Last the command PING demonstrates issuing commands back to the server (PONG).

2. Alarm class
Scheduling functions with seconds level resolution. The callback member function may be called once or periodic. Typical usage is "call function at given time", "call function every hour", etc.

3. Activity class
High level scheduling of functions with start time, duration and period on seconds and minutes level of resolution. The callback member function is periodically called throughout the activity duration. May be used to schedule activities such as "during 10:00 to 14:00 sample sensor every 5 seconds" or "every hour sample sensors every 10 seconds for two minutes", etc.

4. Nucleo (multi-tasking) updates
a. Improved delay handing
The thread level delay function is now based on a delay queue.
b. Performance optimization
The context switch is 11 us, semaphore wait-signal pair is 41 us.
c. Message Passing (Actors)
d. Blink example with threads
Three threads running on an ATtiny85 with 32 bytes stack and 33 byte context per thread. Demonstrates low power when using Cosa Nucleo.

5. Sizeof Benchmark update
List of classes in Cosa and size of instances. Note: static data not included.

6. Cosa example sketches
The example sketch folders have been restructured. There are over 130 test, benchmarking and example sketches in total.
And most of them may be compiled for Tiny, Standard, USB, Mega, Mighty Arduino based boards.

23  International / Fran├žais / Re: programmation avec arduino atmega 1280 on: March 16, 2014, 11:08:08 am

24  Using Arduino / Project Guidance / Re: External Interrupt for MEGA 2560 with SQW from DS1307 on: March 15, 2014, 12:05:49 pm
#include <Wire.h>
#define DS1307_I2C_ADDRESS 0x68

volatile int count;

void setup()
  attachInterrupt(0, compteur , RISING);

void compteur()
  count = count + 1;

void loop()
  int c = count;
  while (c == count);
25  Using Arduino / Project Guidance / Re: Counting length of pulses on: March 13, 2014, 02:12:23 am
Im doing a school project and you guys on here are my only hope  smiley-confuse

I will have an input from another microcontroller and i need to count the length of pulses,
there will be 3 different pulses one after another.

So, basically there will be one pulse for lets say 21 seconds, i need to store this,
then 5 seconds or so after that pulse has finished another will start on the same pin for lets say 15 seconds, i need to store this separately,
finally 5 seconds after the previous pulse there will be one last pulse for 3 seconds and i need to store this separately from the other 2 pulses,
What have you learnt in school? What type of problem is this? Do you know what a finite state machine is? And how it can be programmed? Is the signal stable? What is the distance, length of the cable? Is there noise? How do you indent to connect the two microcontrollers? Does the solution have to be low power? Will the microcontrollers run on battery? Are there programming languages for this type of problem?

26  Development / Other Software Development / Re: Writing menu library, need help with #include's on: March 10, 2014, 06:07:30 pm
What is the compiler trying to tell you? It points to the line;

If you define lcd as a local variable in the constructor M16 it is not available after that. It is created on the stack and then removed after the constructor (M16).

"I guess I have to declare lcd somewhere else?" yepp.

27  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: March 09, 2014, 05:59:30 am
Yes it is possible to write that. It is not implemented in that library,

But why not write it as an uint8_t vector instead.

28  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: March 09, 2014, 04:11:43 am
What library are you using? Your code above is wrong as the OID is a string and you are accessing characters and not numbers. Cheers!
29  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: March 08, 2014, 07:26:11 pm
The OID encoding of 247 is; 128+1,247-128=129,119. Which is what you got.

The full OID should be encoded as 1,3,6,1,4,1,129,119,87,0. This should be prefixed with the length of the OID which is 10.

BTW: is an enterprise OID for AEG Electrocom.

30  Using Arduino / Sensors / Re: Real Time Clock DS1307 and Libraries on: March 08, 2014, 04:46:02 pm
Page 8 in the Product Description for DS1307 ( might be of help. The problem is the library that adjusts the year. The chip handles 00-99 year value (in BCD). The library adjusts to 20XX.

Depending on what you are looking for you will have to at least have to modify the library, find another library or write your own.

Pages: 1 [2] 3 4 ... 25