Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 31
91  Development / Other Software Development / Re: Initial setup routine ( Run once code ). on: March 29, 2014, 05:47:44 pm
How about trying to get the Arduino team to fixing the original problem? The Arduino build does not include the EEMEM section and therefore the initialization of the EEMEM varables are not available. Cheers!
92  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).
https://github.com/mikaelpatel/Cosa/blob/master/examples/Compiler/CosaDiff/CosaDiff.ino

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.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/IOStream/Driver/UART.hh
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/IOStream/Driver/UART.cpp

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)
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/Pinoccio.hh

Cheers!
93  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 20, 2014, 01:34:42 am
Quote
TWI bus frequency setting per device.
On the same wires? If so can that work?
@Graynomad
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.

Cheers!
94  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.

Cheers!
95  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.
Code:
void
Power::clock_prescale(uint8_t factor)
{
  if (factor > 8) factor = 8;
  synchronized {
    CLKPR = (1 << CLKPCE);
    CLKPR = factor;
  }
}
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Power.cpp#L44

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.
https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkThread/CosaBlinkThread.ino

Another Cosa low power example sketch is:
https://github.com/mikaelpatel/Cosa/blob/master/examples/Sandbox/CosaLowPower/CosaLowPower.ino
This sketch demonstrates a number of different strategies to reduce power.

Cheers!

96  Development / Other Software Development / Re: Fast hashing library on: March 18, 2014, 01:54:59 pm
@biocheshire
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" http://www.azillionmonkeys.com/qed/hash.html

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: http://perso.uclouvain.be/fstandae/source_codes/hash_atmel/


Cheers!
97  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.
@Graynomad
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). 

Cheers!
98  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
https://github.com/mikaelpatel/Cosa/tree/master/examples/IoT/ThingSpeak/CosaThingSpeakClient
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.
https://github.com/mikaelpatel/Cosa/blob/master/examples/Time/CosaAlarm/CosaAlarm.ino
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Alarm.hh

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.
https://github.com/mikaelpatel/Cosa/blob/master/examples/Time/CosaActivity/CosaActivity.ino
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Activity.hh

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.
https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkNucleo/CosaBenchmarkNucleo.ino
c. Message Passing (Actors)
https://github.com/mikaelpatel/Cosa/blob/master/examples/Nucleo/CosaNucleoActor/CosaNucleoActor.ino
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. https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkThread/CosaBlinkThread.ino

5. Sizeof Benchmark update
List of classes in Cosa and size of instances. Note: static data not included.
https://github.com/mikaelpatel/Cosa/tree/master/examples/Benchmarks/CosaBenchmarkSizeOf

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

Cheers!
99  International / Fran├žais / Re: programmation avec arduino atmega 1280 on: March 16, 2014, 11:08:08 am
http://translate.google.com/#auto/en/bonjour%0Aj%27ai%20une%20probleme%20qui%20concerne%20la%20programmation%20de%20carte%20arduino%20atmega%201280%0Atout%20d%27abord%20j%27%C3%A9crit%20un%20programme%20de%20commande%20de%20moteur%20pap%20%C3%A0%202%20sens%20et%20%C3%A0%20l%27aide%20de%20potentiometre%0Aet%20je%20fais%20une%20simulation%20%20%C3%A0%20l%27aide%20de%20ISIS%20le%20programmae%20%C3%A7a%20va%20se%20marche%20bien%20avec%20une%20carte%20arduino%20uno%0Amais%20si%20je%20charge%20ce%20programme%20avec%20atmega%20%2C%20rien%20ne%20fonctionne%20%2Cj%27essais%20plusieurs%20fois%20de%20corriger%20ce%20pb%20mais%20rien%20change%0Ameme%20si%20je%20change%20les%20pins%20d%27entree%20et%20de%20sortie%0Avoila%20mon%20programme%20et%20une%20photo%20de%20isis%20avec%20carte%20arduino%20uno%20et%20atmega

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

volatile int count;

void setup()
{
  Wire.begin();
  Serial.begin(9600);
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.write(0x07);
  Wire.write(0x10);
  Wire.endTransmission();
  attachInterrupt(0, compteur , RISING);
}

void compteur()
{
  count = count + 1;
}

void loop()
{
  int c = count;
  while (c == count);
  Serial.println(count);
}
Cheers!
101  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,
Tom
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?

Cheers!
102  Development / Other Software Development / Re: Writing menu library, need help with #include's on: March 10, 2014, 06:07:30 pm
@pekasus
What is the compiler trying to tell you? It points to the line; https://github.com/pekasus/M16/blob/master/M16.cpp#L31

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.

Cheers!
103  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, https://github.com/utz-michael/libraries/blob/master/snmp/Agentuino.h#L333

But why not write it as an uint8_t vector instead.

Cheers.
104  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!
105  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 1.3.6.1.4.1.247.87.0 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: 1.3.6.1.4.1.247 is an enterprise OID for AEG Electrocom.

Cheers!
Pages: 1 ... 5 6 [7] 8 9 ... 31