Cuckoo birds are brood parasites, they use other birds' nests to grow their hatchlings. Mother Cuckoo carefully selects existing nests and puts an egg, only one egg per nest. When Baby Cuckoo hatches, most of the time before other eggs, it just pushes them out the nest. This is its very first instinct, probably not the most rewarding one... Adoptive parents are now only focused on Baby Cuckoo and feed it graciously, with profusion.
This gave me an idea for a new Jaluino family board...
What about mimicing Baby Cuckoo and pushing ATMega chip out of Arduino ? Then plug a tiny board with a Microchip PIC. This is a fast way, even if not the most rewarding one, to get an Arduino clone, isn't it ? And a nice way to take advantage of existing boards and features.
So, Jaluino Cuckoo is very small board aimed to be plugged instead of original ATMega168, on an Arduino board. Does it exist ? No, not yet, but this post is about designing this board to match as close as possible Arduino features. Because, like Mother Cuckoo, we first need to carefully observe our nest in order to lay down our egg and make sure it'll hatch with success.
Arduino Duemilanove or Diecimila will be the victims, the "cuckooed" boards. Both are using Atmel ATmega168 chip (or ATmega328, pin compatible, more memory) with a 16MHz crystal. Both are offering a wide range of features:
While matching pins, it's important to keep in mind this distribution. For instance, PICs can bring at most two PWM channels. At first sight, these two precious channels shouldn't match an Arduino pin with more than one feature. They could be mapped against PD5, PD6 and PB1. But, maybe, the most used one remains PWM0 on pin PD3 (just because this is the first PWM channel), which is also used as external interrupt. Should we use this pin and potentially miss an interrupt ?
ATmega168 pins are dispatched by port (PB, PC and PD). When looking at an Arduino board, pins go like this:
Now that we had a brief overview of the nest, let's choose our Cuckoo ! We can specify the following requirements:
Microchip product matrix tool found few candidates, amongst them, PIC18F25K22 (big brother 18F26K22 is a big fat one, with 64KB memory, but not in production yet).
18F25K22 is an interesting chip, with a lot of features. It provides 32KB memory, 1.5KB RAM, 256B EEPROM. It has a 4xPLL module and can run up to 64MHz (16MIPS, just like ATmega168). This means its max speed is reached using a 64/4 = 16 MHz xtal, the same one that can be found in Arduino! It also has 19 analog inputs, independent, this will help while dispatching and matching Arduino pins. It also has two CCP modules (two PWM channels, seem to be multiplexed over 4 different pins), two MSSP modules to run SPI and I²C at the same time, two USART modules, three 8-bits timers and one 16-bits timer. An interesting chip...
Jaluino Cuckoo can't be as small as a simple 28-pins chip, because some pins must be mapped, a PCB is needed. But there could be enough space to put a "clever" PCB, plugged instead of Atmel chip, yet having enough space to use a shield. As suggestions received from this jallib thread:
How would it plug onto Arduino ? Maybe something like this ?
Cuckoo PCB will have to be cut so it won't be in contact with ICSP connector (or it could plug on it to actually use it ?). Pin headers could be used in place of ATmega chip. PIC18F25K22 certainly won't be able to be plugged on these headers as it would be too thick when using a shield. But it can be moved away and hopefully this would leave enough space to put required components.
Now it's time to draw the schematic and decide how to concretely map pins between Arduino and Jaluino Cuckoo. In a major and critical step, we will have to ensure there's no physical constraints related to plugging shields with a cuckooed Arduino (btw, where's the reset button ?...). Finally, we will have to justify why creating such a useless board.
Feel free to react, either on this jallib thread http://groups.google.fr/group/jallib/browse_thread/thread/ec6324b87c595531 or by commenting this page.