Show Posts
Pages: 1 2 3 [4] 5 6 ... 29
46  Development / Other Hardware Development / Re: Multi ATtiny programmer on: May 30, 2014, 02:46:09 pm
I use a simpler solution; a 40 pin ZIF socket, upper end for AttinyX5 and lower end for AttinyX4. See http://cosa-arduino.blogspot.se/2013/04/programming-attinyx5.html
NB. The blog shows the early design with only AttinyX5. Since then I have added support for AttinyX4.

Cheers!
47  Using Arduino / Installation & Troubleshooting / Re: Help with Cosa Installation on: May 28, 2014, 02:30:09 am
Cosa should be really simple to install and get running. Sorry to hear that you are having problems with that. Could you please provide some more information?

1. What version of the Arduino IDE are you using?
The support for 1.0.X was deprecated a few weeks back as the development focused on 1.5.X and the new AVR toolchain BUT as there has been a number of requests for keeping the 1.0.X support it now available again (See https://github.com/mikaelpatel/Cosa/issues/176). If you are using 1.0.X please download Cosa from github and install again. https://github.com/mikaelpatel/Cosa/archive/master.zip

2. What Arduino board are you using?
You MUST select a Cosa prefixed board in the IDE Tools>Board menu. This is how the Cosa core is selected. The Cosa example sketches do not compile with the Arduino core.

Please note that Cosa is not an Arduino(TM) product. Support requests should be posted on the Cosa github issue list. https://github.com/mikaelpatel/Cosa/issues/new. This will give you the best and quickest response.

Cheers!
48  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 27, 2014, 04:37:52 am
Some news on the latest Cosa updates:

1. Restored support for Arduino IDE 1.0.X
The Arduino 1.0.X IDE support was deprecated but has been restored after some requests.

2. Ethernet Shield example sketch robustness
The SD and W5100 device on the Ethernet Shield may interfere each other if not correctly disabled. The Ethernet example sketches have been updated to avoid the interference and improve robustness.

3.  More program memory free space on Leonard/Micro/Lilypad-USB (ATmega32U4)
The USB/CDC functionality is only added when needed. This allows larger sketches on ATmega32U4 devices. Compiling an empty sketch with Arduino/Wiring (1.5.6) gives:
Code:
Sketch uses 3,976 bytes (13%) of program storage space. Maximum is 28,672 bytes.
Global variables use 158 bytes (6%) of dynamic memory, leaving 2,402 bytes for local variables. Maximum is 2,560 bytes.
The latest Cosa update gives:
Code:
Sketch uses 290 bytes (1%) of program storage space. Maximum is 28,672 bytes.
Global variables use 0 bytes (0%) of dynamic memory, leaving 2,560 bytes for local variables. Maximum is 2,560 bytes.

4. LCD IO Adapter abstraction for PCD8544 and ST7565
The HD78440 LCD (1602/2004) IO Adapter abstraction is now implemented for the PCD8544 and ST7565. The two adapters are 1) serial output pin (Serial3W) and 2) SPI output (SPI3W).
Interface (LCD::IO): https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/LCD.hh#L184

5. Pin Benchmarks
The Cosa Pin classes have been further optimized and there are a set of new benchmark run files.
a. Arduino 1.0.5/1.5.6-r2 toolchain
https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkPins/arduino-1.0.5.run
b. Arduino Nightly build with new AVR toolchain (GCC 4.8.1)
https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkPins/arduino-avr-toolchain-nightly-gcc-4.8.1.run
c. Arduino Nightly build with new AVR toolchain (GCC 4.8.1) with link-time-optimization
https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkPins/arduino-avr-toolchain-nightly-gcc-4.8.1-lto.run

6. Improved HTTP::Server response io-stream handling
The support for writing simple HTTP servers has been improved with IOStream binding and parsing path, query and request type.
Interface: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/INET/HTTP.hh#L107
Example: https://github.com/mikaelpatel/Cosa/blob/master/examples/Ethernet/CosaWebServer/CosaWebServer.ino#L97

7. Completed support for Teensy 2.0/Teensy++ 2.0

Cheers!
49  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 18, 2014, 03:25:26 pm
Some news on the latest Cosa updates:

1. Improving Shift-Register Parallel output class (SRPO<N>)
Improving the SPI device driver for cascaded 74HC595 shift registers (previously SR3W); a very fast port expander. Includes a new internal class, SRPO<N>::OutputPin, which acts as a Cosa OutputPin (same interface but cannot replace).
Interface (and source): https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI/Driver/SRPO.hh
Example: https://github.com/mikaelpatel/Cosa/blob/master/examples/Sandbox/CosaSRPO/CosaSRPO.ino
Below is a snippet from the example sketch.
Code:
/**
 * @file CosaSRPO.ino
 * @version 1.0
 * ...
 * @section Description
 * Demonstrate Cosa N-Shift Register (SRPO) SPI device driver and Low
 * Power handling. Cascade two shift register (74HC595) and connect
 * LEDs. Circuit below shows ATtinyX5 and 2 X 74HC595 schematics.
 *
 * @section Circuit
 *                         ATinyX5  
 *                       +----U----+
 * (/RESET)------------1-|PB5   VCC|-8------------(VCC)
 * (D3/A3)--------+----2-|PB3   PB2|-7---------(D2/SCK)----+
 *                |    3-|PB4   PB1|-6--------(D1/MOSI)--+ |
 * (GND)----------(----4-|GND   PB0|-5                   | |
 *                |      +---------+                     | |
 *                +--------------------------------------(-(-+
 *                                                       | | |
 *                         74HC595    (VCC)              | | |
 *                       +----U----+    |                | | |
 * (LCD1/GREEN)--------1-|Q1    VCC|-16-+                | | |
 * (LCD1/BLUE)---------2-|Q2     Q0|-15------(LCD1/RED)  | | |
 *                     3-|Q3    SER|-14---(MOSI/D11/D1)--+ | |
 *                     4-|Q4    /OE|-13-----------(GND)    | |
 *                     5-|Q5   RCLK|-12-----(EN/D10/D3)----(-+
 *                     6-|Q6   SCLK|-11----(SCK/D13/D2)----+ |
 *                     7-|Q7    /MR|-10-----------(VCC)    | |
 *                   +-8-|GND   Q7S|--9------------------+ | |
 *                   |   +---------+                     | | |
 *                   |      0.1uF                        | | |
 *                 (GND)-----||-------(VCC)              | | |
 *                                      |                | | |
 *                         74HC595      |                | | |
 *                       +----U----+    |                | | |
 * (LCD2/GREEN)--------1-|Q1    VCC|-16-+                | | |
 * (LCD2/BLUE)---------2-|Q2     Q0|-15------(LCD2/RED)  | | |
 *                     3-|Q3    SER|-14------------------+ | |
 *                     4-|Q4    /OE|-13-----------(GND)    | |
 *                     5-|Q5   RCLK|-12--------------------(-+
 *                     6-|Q6   SCLK|-11--------------------+
 *                     7-|Q7    /MR|-10-----------(VCC)
 *                   +-8-|GND   Q7S|--9
 *                   |   +---------+  
 *                   |      0.1uF      
 *                 (GND)-----||-------(VCC)
 *
 * This file is part of the Arduino Che Cosa project.
 */

#include "Cosa/Power.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/SPI/Driver/SRPO.hh"

// Power-down delay
#define POWERDOWN_DELAY(ms) \
  do { \
    uint8_t mode = Power::set(SLEEP_MODE_PWR_DOWN); \
    Power::all_disable(); \
    delay(ms); \
    Power::all_enable(); \
    Power::set(mode); \
  } while (0)

// Two cascaded shift registers; use D10/D3 as chip select pin,
// MOSI for serial data and SCK for clock.
SRPO<2> port;

void setup()
{
  // Setup the watchdog; use power-down period as wakeup time
  Watchdog::begin(512);

  // Blink the blue leds; local pin variable
  SRPO<2>::OutputPin blue1(&port, 2);
  SRPO<2>::OutputPin blue2(&port, 10);
  for (uint8_t i = 0; i < 10; i++) {
    blue1.toggle();
    blue2.toggle();
    port.update();
    POWERDOWN_DELAY(512);
  }
}

void loop()
{
  // Cycle through the shift-register parallel output pins (0..15)
  static uint8_t pin = 0;

  // Set pin and update shift register
  port.set(pin);
  port.update();
  POWERDOWN_DELAY(512);

  // Clear pin and update shift register
  port.clear(pin);
  port.update();
  POWERDOWN_DELAY(512);

  // Step to the next pin (0..15)
  pin = (pin + 1) & 0xf;
}

2. Support for MIDI Note numbers
Calculate MIDI note number frequency.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Note.hh#L207

3. Pin/Port Scanner
The Cosa example library contains a number of tools; TWI and OWI scanners. A new  tool for scanning pin/ports has been added.

https://github.com/mikaelpatel/Cosa/blob/master/examples/Tools/CosaPinScanner/CosaPinScanner.ino

4. Improved documentation
List of supported boards and MCUs with links to board definitions and layout. https://github.com/mikaelpatel/Cosa#supported-boards-and-mcus.

5. Improved Analog pin class
Reduce SRAM footprint for Cosa AnalogPin instances; 12 => 9 bytes.  

Cheers!
50  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 12, 2014, 02:52:07 pm
Some news on the latest Cosa updates:

1. Support for Teensy 2.0 and Teensy++ 2.0
Board definition: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/PJRC/Teensy_2_0.hh and IDE/build settings https://github.com/mikaelpatel/Cosa/blob/master/boards/teensy.txt. Part of the Cosa boards.txt file; https://github.com/mikaelpatel/Cosa/blob/master/boards.txt#L512
Compile Cosa sketches with the Arduino IDE and use the Teensy Loader https://www.pjrc.com/teensy/loader.html

2. Tone and Notes
Port of toneAC (https://code.google.com/p/arduino-tone-ac/) to Cosa. Refactoring to a more object-oriented version and extended with a support class for notes;  
Interface: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Tone.hh and https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Note.hh
Example: https://github.com/mikaelpatel/Cosa/blob/master/examples/Sandbox/CosaTone/CosaTone.ino


3. Refactoring Cosa board definition structure to allow multiple vendors/clones
See https://github.com/mikaelpatel/Cosa/tree/master/boards and https://github.com/mikaelpatel/Cosa/tree/master/cores/cosa/Cosa/Board. Each board description contains an ASCII pin layout schematics. Below are some examples.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/Arduino/Uno.hh#L44
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/Arduino/LilyPad.hh#L44
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/Arduino/Nano.hh#L44
The documentation of the port-pin mapping to enum data types is improved.

4. Support for Arduino Yún
Lately there has been some requests for support for Cosa on Yún. This would require implementing the Yún WiFi/ATmega32U4 bridge protocol in Cosa and wrapping that in the Cosa Socket and INET interfaces. See discussion on blog; http://cosa-arduino.blogspot.se/2013/03/news-virtual-wire-interface.html?showComment=1399264846651#c1778259001644695726

Cheers!
51  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 03, 2014, 07:26:30 pm
@arduinoDave

Typically if the Cosa header files are not found you might have forgot to select one of the "Cosa Boards". With Arduino 1.0.X you do not need the extra "avr" level in the hardware folder.

I work mainly on Linux (Ubuntu) with Emacs as editor and the Arduino IDE for build, download and serial monitor. My brother works on the other hand on Mac OSX and has recently put together a pre-packaged release of Cosa on github; https://github.com/epatel/Cosa/releases

There is excellent install support in embedXcode.

Cheers!
52  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 03, 2014, 03:09:20 pm
Some news on the latest Cosa updates:

1. SR3W
New three wire SPI device driver that supports cascaded shift registers. Uses MOSI, SCK and CS.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI/Driver/SR3W.hh
https://github.com/mikaelpatel/Cosa/blob/master/examples/Sandbox/CosaSR3W/CosaSR3W.ino

2. Faster SPI block transfer
Two new SPI member functions (transfer_start/await) to allow faster SPI transactions with interleaving of SPI transfer and processing (e.g. fetch next data element, calculate check sum, etc).
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI.hh#L205
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI.cpp#L229

3. SD/FAT16 performance improvement
Using the new SPI member functions to improve the SD and FAT16 performance. Example below:
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/SPI/Driver/SD.cpp#L135

4. Documentation
Circuit descriptions added to source code documentation. Some examples:
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/LCD/Driver/HD44780.hh#L734
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Board/ATtinyX5.hh#L43
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/OWI/Driver/DS18B20.hh#L31

Cheers!
53  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 29, 2014, 01:29:12 pm
A short update on introducing AVR Toolchain with GCC 4.8.1 and using link time optimization. Below are build statistics for some of the Cosa example sketches (Arduino UNO, program storage space/dynamic memory). Left column for Arduino 1.5.6 (http://arduino.cc/en/Main/Software#toc3) and the right column Arduino Nightly Build with GCC 4.8.1 (https://groups.google.com/a/arduino.cc/forum/#!msg/developers/21G5w2HbUOg/-aH8wQJP6x8J).
Code:
                    1.5.6-r2     4.8.1+lto
Empty Sketch         210/0        154/0
CosaBenchmarkPins    18010/420    13402/451
CosaBlink            1060/21      904/18
CosaBlinkMinimal     266/2        194/0  
CosaCanvasST7735     19790/600    17120/629
CosaSNMP             20936/662    17456/697
CosaMQTThumidity     17528/575    15072/674
CosaThingSpeakClient 23452/989    20884/1046
CosaHD44780          5662/149     4964/196

This gives an idea of the program size reduction. There is also an improvement in performance.

Cheers!
54  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 27, 2014, 03:05:43 pm
WOW! I am glad I found Cosa!
A huge amount of quality work in those libraries.
THANK YOU!
Thanks for your interest in Cosa. Please feel free to use the github issue list for suggestions, improvements, bugs, etc. https://github.com/mikaelpatel/Cosa/issues?state=open

On the issues list you can also find what I am working on right now (items marked backlog). The latest focus has been on 1) improving documentation and coding style to further enhance using embedXcode. and 2) adapting for the new avr toolchain (gcc 4.8.1).

Cosa has its own platform.txt file with compiler and tools options. The build enables all warnings from the compiler (-Wall and -Wextra). This is to improve code quality and get as much support from the compiler as possible. The goal is to keep Cosa "compiler warning clean" at all time.

With the latest update the Cosa build uses link time optimization (-flto). Together with some improvements the Pin classes are now even faster with Output::toggle() as fast as 62 ns (@ 16 Mhz). Details from the benchmarking can be found in the benchmark sketches; https://github.com/mikaelpatel/Cosa/tree/master/examples/Benchmarks, and for the Pins classes; https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkPins/CosaBenchmarkPins.ino#L530

Cheers!
55  Using Arduino / Microcontrollers / Re: attiny 85, any pointers?/ on: April 27, 2014, 02:46:50 pm
Have you checked out the 'new breed' of Pro mini yet? Is there a pin layout drawing of this new version available?
I have several of the old style and would like to try a ISP friendly version, so I guess I'll order a couple also.
Lefty
Found this image that might help.

Cheers!
56  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 22, 2014, 03:29:42 pm
The Cosa Soft UART is now completed. An interrupt driven receiver has been added. Verified for 57600 bps on Arduino Nano (ATmega328) and 38400 bps on ATtiny84 with internal 8 MHz clock.

Example sketch: https://github.com/mikaelpatel/Cosa/blob/master/examples/UART/CosaSoftUART/CosaSoftUART.ino
Interface: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Soft/UART.hh

Cheers!
57  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 19, 2014, 09:10:59 am
I use Arduino 1.0.5. on Windows 7
The path of sketches is "D:\sketchbook"
I have unzip "Cosa" in this path "D:\sketchbook\hardware\Cosa"
That looks fine so then we are back to the board setting. It has to be one of the Cosa prefixed boards otherwise the compiler will not be able to find the correct setting and will not use the correct include path.

See the footer in the IDE window. You need that setting. Double check the installation so that you have not accidentally added a folder level. The Cosa directory should contain a bunch of files and the cores directory.  

Cheers!
58  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 19, 2014, 08:37:13 am
I guess you mean "Cosa Tiny (ATtiny84, 8 MHz internal clock)". In that case you have not installed correctly. What is the path to the install directory?

Cheers!
59  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 19, 2014, 08:21:26 am
My guess is that you have not selected the correct board. You need to select one of the Cosa Arduino boards. See the Tools>Boards menu in the Arduino IDE.

Cheers!
60  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: April 14, 2014, 04:35:52 pm
Some news on the latest updates:

1. Improved documentation
The on-line documentation (web/embedXcode) has been extended with circuit illustrations. Below are a few examples:
http://dl.dropboxusercontent.com/u/993383/Cosa/doc/html/dc/d6e/classST7735.html#friends
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Canvas/Driver/ST7735.hh#L39
https://github.com/mikaelpatel/Cosa/blob/master/examples/Canvas/CosaCanvasHCSR04/CosaCanvasHCSR04.ino#L23
The class documentation has also been restructured to improve readability.

2. Improved LCD 4-bit adapter
The Cosa LCD (HD44780) 4-bit parallel adapter may be used with all boards supported by Cosa. The LCD keypad shield works correctly on Uno, Mega, Leonardo, etc.
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/LCD/Driver/HD44780.hh#L297
https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/LCD/Driver/HD44780_IO_Port4b.cpp

3. LCD horizontal and vertical bars
New example sketches that shows how to implement horizontal and vertical bars for progress indication or value.
https://github.com/mikaelpatel/Cosa/blob/master/examples/LCD/CosaLCDvbar/CosaLCDvbar.ino
https://github.com/mikaelpatel/Cosa/blob/master/examples/LCD/CosaLCDhbar/CosaLCDhbar.ino

4. Additional footprint reduction
Fine tuning of the Cosa startup code and classes to reduce the footprint.

5. Input/OutputPin optimizations
Additional optimization of the Cosa Input- and OutputPin classes to allow speedup X3-X10 compared to Arduino digitalRead/Write. See Cosa Benchmarks.
https://github.com/mikaelpatel/Cosa/blob/master/examples/Benchmarks/CosaBenchmarkPins/CosaBenchmarkPins.ino#L529

6. Circuit descriptions
Circuit descriptions are available in device header files, doxygen documentation and in example sketches.

Cheers!
Pages: 1 2 3 [4] 5 6 ... 29