Tuesday 16 August 2011

Introducing the Calunium - An Arduino clone based on the ATmega644P/ATmega1284P

Calunium 644P
Calunium built on stripboard. This version uses the ATmega644P, but the ATmega1284P can also be used. Click on the image for an annotated version.

Aims of the project
  • Create an Arduino clone with more than 32K program memory.
  • Produce a design which uses only through-hole components.
  • Shield-compatible - with pin functionality as close as possible to the original Arduino. 

Sanguino and other related designs
How does this differ from the Sanguino and other related designs (Bobuino, Mosquino etc)? The Sanguino can't accept Arduino shields. Although it is possible to program it with the Arduino IDE the pin mapping is functionally very different to the Arduino; for example the first UART is connected to D8-D9, not D0-D1, and the SPI pins are connected to D5-D7, not D11-D13. The Bobuino looks to be a very nice design but I ruled it out as it uses surface mount components, and the ISP header is not in the standard location (as required for the Ethernet shield). The headers on the Mosquino aren't shield compatible.

Sign-Advancetech appear to make a board which appears very close to what I want - I'd probably get one if I could easily buy it in the UK.


Fritzing design files and software

Calunium stripboard design
Click on image for annotated version.

The Fritzing design files can be found on GitHub, http://github.com/stevemarple/Calunium. Modifications to the Arduino IDE to support Calunium are under development but will be added soon.


Creative Commons Licence
Calunium by Steve Marple is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

About the name
As Arduino is an Italian project, this project takes its name from the Roman name for Lancaster, Calunium, where the design of this clone originates.

Building the Calunium
Future blog posts will show the construction of the Calunium. I also have a design for a shield-compatible strip board Arduino but I haven't had time to put it together yet.

Pin mapping
ArduinoAtmega328PAtmega644PATmega2560
D0PD0 (PCINT16/RXD)PD0 (PCINT24/RXD0/T3)PE0 (RXD0/PCINT8)
D1PD1 (PCINT17/TXD)PD1 (PCINT25/TXD0)PE1 (TXD0)
D2PD2 (PCINT18/INT0)PD2 (PCINT26/RXD1/INT0)PE4 (OC3B/INT4)
D3PD3 (PCINT19/OC2B/INT1)PD3 (PCINT27/TXD1/INT1)PE5 (OC3C/INT5)
D4PD4 (PCINT20/XCK/T0)PB0 (PCINT8/XCK0/T0)PG5 (OC0B)
D5PD5 (PCINT21/OC0B/T1)PB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CINT5)PF5 (ADC5/TMS)
A6PC6 (ADC6/PCINT14)PA6 (ADC6/PCINT6)PF6 (ADC6/TDO)
A7PC7 (ADC7/PCINT15)PA7 (ADC7/PCINT7)PF7 (ADC7/TDI)

12 comments:

  1. Hi dude,
    I've tried your bootloader and working well. But I've a problem with Serial Communication like ASCIITable sketch example. Can you check that example? Tx data starts when serial monitor of Arduino IDE close.

    Regards,
    pak

    ReplyDelete
  2. hello
    Described above refers to the plinth PDIP 40
    I have atmega 644 socket TQFP 44

    how things happen then

    ReplyDelete
    Replies
    1. I've not used the TQFP version but I believe the extra pins are taken by additional VCC and GND connections, the actual hardware is entirely compatible with the DIP version I use. Obviously the TQFP package is a lot less convenient with stripboard as used here. For the later PCB versions of Calunium there should be no difference beyond the PCB footprint.

      Delete
  3. I am trying to program an Atmega 1284p in TQFP 44 pin package using Calunium. I am new to Arduino IDE. I am trying to control and keypad / display and an RX/TX interface. Is there a step by step description as to how to do this. In particular, can I use the port names e.g., PA5, PA6 etc to do the mapping. I can program it using a USBTiny pocket programmer.
    Thanks
    Ganesh

    ReplyDelete
  4. Download the Arduino 1.6.x IDE. Inside the sketches directory create a new directory called "hardware". Download the Calunium repository from Github and copy the software/arduino-1.6/calunium directory into the hardware directory. You should now have a directory called sketches/hardware/calunium. Then choose an appropriate board in the IDE. You either need to upload using the pocket programmer or write a bootloader to the ATmega128P. It doesn't matter that you are using the 44 pin model, just remember make sure you use the correct physical pin numbers for the port names you select.

    ReplyDelete
  5. Hi Steve,
    When I followed your steps, I could not find the Calunium devices in board, and I keep getting the following error message. What am I doing wrong?

    Could not find boards.txt in C:\Program Files (x86)\Arduino\hardware\Calunium-dev-arduino-1.6.x\Calunium-dev-arduino-1.6.x. Is it pre-1.5?
    Could not find boards.txt in C:\Program Files (x86)\Arduino\hardware\Calunium-dev-arduino-1.6.x\hardware. Is it pre-1.5?
    Could not find boards.txt in C:\Program Files (x86)\Arduino\hardware\Calunium-dev-arduino-1.6.x\software. Is it pre-1.5?
    WARNING: Error loading hardware folder C:\Program Files (x86)\Arduino\hardware\Calunium-dev-arduino-1.6.x
    No valid hardware definitions found in folder Calunium-dev-arduino-1.6.x.

    ReplyDelete
  6. Hi Steve,
    Got it working!!
    I had to open the file and put only the calnium software part in the hardware profile. And it worked!!
    Thanks
    Ganesh

    ReplyDelete
  7. Hi Steve,
    Although it all worked, it turns out that when I try to run the 1284P with a 20 MHz Xtal, it does not do anything. In fact the Xtal does not oscillate. I have the same 22pf capacitors I have used in other circuits well with the same Xtal. Is there something in the code that prevents a 20 MHz Xtal from working.
    I have tried all kinds of things but the xtal acts dead. I even put in a new Xtal. Am I doing something wrong?
    Thanks
    Ganesh

    ReplyDelete
  8. It is very important to keep the connections to the crystal and load capacitors short, especially for higher frequencies; ideally no more than 20mm long.
    Did you set the fuses correctly? You need the option for an external crystal, with operation >=8MHz. Choose the longest startup time (16K clocks + 65ms).
    There is nothing is the code which prevents 20MHz operation though for the timings to be correct it is essential that the bootloader and Arduino code are both compiled for the actual frequency in use.

    ReplyDelete
  9. Steve,
    Thanks for the information. I am using a 20 MHz Xtal and very short lines and recommended caps in the circuit. It is a circuit that works well with many other microcontrollers.
    In the present circuit I am not using a bootloader but programming via a tinyUSB. Would this make any difference.
    And indeed I am using the slowest time.
    Thanks
    Ganesh

    ReplyDelete
  10. Steve,
    How do you set the fuses correctly? I thought I did, but it did not do anything. So I went to Arduino Studio 7, and under Tools, entered the 1284P and 20 MHz external oscillator with 16K clocks + 65 mSecs. It displayed Fuse values of Low = 0x7F, High of 0x99 and Extended of 0xFF. I entered those in the boards.txt file, and that did not do anything either.
    I am also not having any success usint the internal RC oscillator. They are all extremely slow.
    I should add that I only installed the Calunium software file from Calunium-dev-arduino-1.6x > software > arduino-1.6 > calunium in my hardware file in Programs under Arduino. Should I have done something else.
    Thanks!!
    Ganesh

    ReplyDelete

Note: only a member of this blog may post a comment.