Microduino Compile

Who has used Microduino boards on Mac with OSX 10.9.3 Ardunio IDE 1.5.6-r2
Success ...Compile and load for Microduino 328, using UNO in the IDE selection.
Success ...Compile and load for Microduino 32u4, using Leonardo in the IDE selection....
Now for the 644p board ?
Downloaded the boards.txt etc and installed in /contents/Resources/hardware/arduino
Can now the select a Microduino board, BUT all hang during compile.

error java.lang.NullPointerException

Any ideas??

microduino ?
do you have a link to the supplier?

These guys..
http://www.microduino.cc/

Randcook:
Who has used Microduino boards on Mac with OSX 10.9.3 Ardunio IDE 1.5.6-r2

error java.lang.NullPointerException

Any ideas??

Have you tried building under 1.0.5 instead of 1.5.6-r2? The problem may be 1.5.6-r2, and you've stumbled onto a beta version bug.

Also, if you post the boards.txt entry for the microduino 644, someone may be able to spot something that could be causing a problem.

@pico,
Thanks,
Will try under 1.0.5
The boards.txt came from Microduino

Do you need/have you installed the Microduino core+ files? I don't think Arduino IDE 1.0.5 does not natively support 644 processors.

Have downloaded/installed the files from Microduino.
Have amended the boards.txt entry core=standard
Now compiles?
How do I support/load a sketch to 644 processor.
Have you guys achieved this,
Have a sketch > 40k all Ok on a Mega, but I want a small board hence Microduino 644
Cheers
Peter

Riva:
Do you need/have you installed the Microduino core+ files? I don't think Arduino IDE 1.0.5 does not natively support 644 processors.

Surprisingly, it turns out the 1.0.5 core does support the 644/1284p with almost no change. This long thread delves into the details:

Randcook:
Have downloaded/installed the files from Microduino.
Have amended the boards.txt entry core=standard
Now compiles?
How do I support/load a sketch to 644 processor.

If there is a bootloader installed on the 644, then you can load a sketch as per the "normal" Arduino IDE way.

Otherwise, you need an ISP programmer (e.g., USBasp) to program the chip with your sketch, or alternatively load a bootloader to enable "normal" bootloader programming.

Do microduinos come programmed with a bootloader? If so, one would assume their boards.txt entry is configured to agree with the specs of the bootloader (protocol, speed).

Randcook:
Have you guys achieved this,
Have a sketch > 40k all Ok on a Mega, but I want a small board hence Microduino 644
Cheers
Peter

I've certainly programmed a 644 from Arduino 1.0.5. An appropriate boards.txt entry needs to be there, and be correct, though. Can you post the microduino supplied boards.txt file so we can have a look at it?

@pico
boards.txt

# See: http://zh.microduino.wikia.com

##############################################################
328p16m.name= Microduino Core (Atmega328P@16M,5V)
328p16m.upload.protocol=arduino
328p16m.upload.maximum_size=32256
328p16m.upload.speed=115200
328p16m.bootloader.low_fuses=0xFF
328p16m.bootloader.high_fuses=0xDE
328p16m.bootloader.extended_fuses=0x05
328p16m.bootloader.path=optiboot
328p16m.bootloader.file=optiboot_micro_328p_16m.hex
328p16m.bootloader.unlock_bits=0x3F
328p16m.bootloader.lock_bits=0x0F
328p16m.build.mcu=atmega328p
328p16m.build.f_cpu=16000000L
328p16m.build.core=arduino
328p16m.build.variant=standard
##############################################################
328p8m.name= Microduino Core (Atmega328P@8M,3.3V)
328p8m.upload.protocol=arduino
328p8m.upload.maximum_size=32256
328p8m.upload.speed=57600
328p8m.bootloader.low_fuses=0xFF
328p8m.bootloader.high_fuses=0xDE
328p8m.bootloader.extended_fuses=0x05
328p8m.bootloader.path=optiboot
328p8m.bootloader.file=optiboot_micro_328p_8m.hex
328p8m.bootloader.unlock_bits=0x3F
328p8m.bootloader.lock_bits=0x0F
328p8m.build.mcu=atmega328p
328p8m.build.f_cpu=8000000L
328p8m.build.core=arduino
328p8m.build.variant=standard
##############################################################
168pa16m.name= Microduino Core (Atmega168PA@16M,5V)
168pa16m.upload.protocol=arduino
168pa16m.upload.maximum_size=15872
168pa16m.upload.speed=115200 
168pa16m.bootloader.low_fuses=0xFF
168pa16m.bootloader.high_fuses=0xDD
168pa16m.bootloader.extended_fuses=0x04
168pa16m.bootloader.path=optiboot
168pa16m.bootloader.file=optiboot_micro_168pa_16m.hex
168pa16m.bootloader.unlock_bits=0x3F
168pa16m.bootloader.lock_bits=0x0F 
168pa16m.build.mcu=atmega168p
168pa16m.build.f_cpu=16000000L
168pa16m.build.core=arduino
168pa16m.build.variant=standard
##############################################################
168pa8m.name= Microduino Core (Atmega168PA@8M,3.3V)
168pa8m.upload.protocol=arduino
168pa8m.upload.maximum_size=15872
168pa8m.upload.speed=57600
168pa8m.bootloader.low_fuses=0xE2
168pa8m.bootloader.high_fuses=0xDD
168pa8m.bootloader.extended_fuses=0x04
168pa8m.bootloader.path=optiboot
168pa8m.bootloader.file=optiboot_micro_168pa_8m.hex
168pa8m.bootloader.unlock_bits=0x3F
168pa8m.bootloader.lock_bits=0x0F 
168pa8m.build.mcu=atmega168p
168pa8m.build.f_cpu=8000000L
168pa8m.build.core=arduino
168pa8m.build.variant=standard
##############################################################
644pa16m.name= Microduino Core+ (Atmega644PA@16M,5V)
644pa16m.upload.protocol=arduino
644pa16m.upload.maximum_size=64512
644pa16m.upload.speed=115200
644pa16m.bootloader.low_fuses=0xFF
644pa16m.bootloader.high_fuses=0xDE
644pa16m.bootloader.extended_fuses=0xFD
644pa16m.bootloader.path=optiboot
644pa16m.bootloader.file=optiboot_micro_644pa_16m.hex
644pa16m.bootloader.unlock_bits=0x3F
644pa16m.bootloader.lock_bits=0x0F
644pa16m.build.mcu=atmega644p
644pa16m.build.f_cpu=16000000L
644pa16m.build.core=arduino
644pa16m.build.variant=plus
##############################################################
644pa8m.name= Microduino Core+ (Atmega644PA@8M,3.3V)
644pa8m.upload.protocol=arduino
644pa8m.upload.maximum_size=64512
644pa8m.upload.speed=57600 
644pa8m.bootloader.low_fuses=0xFF
644pa8m.bootloader.high_fuses=0xDE
644pa8m.bootloader.extended_fuses=0xFD
644pa8m.bootloader.path=optiboot
644pa8m.bootloader.file=optiboot_micro_644pa_8m.hex
644pa8m.bootloader.unlock_bits=0x3F
644pa8m.bootloader.lock_bits=0x0F 
644pa8m.build.mcu=atmega644p
644pa8m.build.f_cpu=8000000L
644pa8m.build.core=arduino
644pa8m.build.variant=plus
###############################################################
1284p16m.name= Microduino-Core+ (ATmega1284P@16M,5V)
1284p16m.upload.protocol=arduino
1284p16m.upload.maximum_size=130048
1284p16m.upload.speed=115200
1284p16m.bootloader.low_fuses=0xFF
1284p16m.bootloader.high_fuses=0x9E
1284p16m.bootloader.extended_fuses=0xFD
1284p16m.bootloader.path=optiboot
1284p16m.bootloader.file=optiboot_micro_1284_16m.hex
1284p16m.bootloader.unlock_bits=0x3F
1284p16m.bootloader.lock_bits=0x0F
1284p16m.build.mcu=atmega1284p
1284p16m.build.f_cpu=16000000L
1284p16m.build.core=arduino
1284p16m.build.variant=plus
###############################################################
1284p8m.name= Microduino-Core+ (ATmega1284P@8M,3.3V)
1284p8m.upload.protocol=arduino
1284p8m.upload.maximum_size=130048
1284p8m.upload.speed=57600
1284p8m.bootloader.low_fuses=0xFF
1284p8m.bootloader.high_fuses=0x9E
1284p8m.bootloader.extended_fuses=0xFD
1284p8m.bootloader.path=optiboot
1284p8m.bootloader.file=optiboot_micro_1284_8m.hex
1284p8m.bootloader.unlock_bits=0x3F
1284p8m.bootloader.lock_bits=0x0F
1284p8m.build.mcu=atmega1284p
1284p8m.build.f_cpu=8000000L
1284p8m.build.core=arduino
1284p8m.build.variant=plus

##############################################################

32u416m.name=Microduino-Core-32u4
32u416m.upload.protocol=avr109
32u416m.upload.maximum_size=28672
32u416m.upload.speed=57600
32u416m.upload.disable_flushing=true
32u416m.bootloader.low_fuses=0xff
32u416m.bootloader.high_fuses=0xd8
32u416m.bootloader.extended_fuses=0xcb
32u416m.bootloader.path=caterina
32u416m.bootloader.file=Caterina-Leonardo.hex
32u416m.bootloader.unlock_bits=0x3F
32u416m.bootloader.lock_bits=0x2F
32u416m.build.mcu=atmega32u4
32u416m.build.f_cpu=16000000L
32u416m.build.vid=0x2341
32u416m.build.pid=0x8036
32u416m.build.core=arduino
32u416m.build.variant=32u4
/code]

Randcook:
@pico
boards.txt

hi Peter,

I download the microduino core library stuff, including the boards.txt as you posted above, and I repliciated a 644p build as follows:

  1. downloaded microduino core files, unzipped, copied to "Microduino" folder to "hardware" folder in Arduino 1.0.5 install (Win 7)
  2. started 1.0.5 IDE, selected "Microduino Core+ (Atmega644PA@16M,5V)"from Tools|Board. Burnt bootloader to 644p chip using USBasp as the programmer. (I used my "Bambuino Bob" board with a 644p chip installed to replicate a microduino644 as closely as I could.)
  3. Attached USB-to-TLL mini board to Bambuino Bob. Built and uploaded a sketch, still with "Microduino Core+ (Atmega644PA@16M,5V)" selected from Tools|Board.
  4. Built, uploaded and ran sketch without problems.

So I can verify that all the Microduino core files work for a 644p chip using Arduino 1.0.5, at least under Windows 7.

Randcook:
Downloaded the boards.txt etc and installed in /contents/Resources/hardware/arduino

Actually, this may be the source of all your woes. It looks like you may have installed the Microduino core files in the wrong directory.

The "Microduino" folder (containing botloaders, cores, variants, boards.txt, Readme,txt) should be copied into the hardware" folder, not the the hardware/arduino" folder.

So when you look at the hardware folder, you'll see:

arduino
Microduno
tools
(plus any other folders you've set up here...)

Randcook:
Can now the select a Microduino board, BUT all hang during compile.

error java.lang.NullPointerException

This error is consistent with the IDE not being able to locate the core files described in the boards.txt file (which is why I looked a bit more closely at where you were installing the core files).

@pico,
Thanks,
IDE 1.0.5
Moved the Folder up one/back level.
Can select boards compile and upload OK
IDE 1.5.6
Can even see the boars to select?
Also received my "skinnybob" yesterday.
Cheers
Peter

Randcook:
@pico,
Thanks,
IDE 1.0.5
Moved the Folder up one/back level.
Can select boards compile and upload OK

Sounds good.

Randcook:
IDE 1.5.6
Can even see the boars to select?

The boards aren't showing properly under 1.5.6? All boards, or just the Microduino boards?

Randcook:
Also received my "skinnybob" yesterday.

Wow -- that was faster than expected! Hang tight, I'll send you a copy of the latest version of the assembly instructions by email.

BTW, since you'll have to download a copy of the updated "Mighty-1284p" core to run your Skinny Bob board, you also have the option of using that core with your Microduino644 as well, if you want to. You will then have features that will bring the core up to date with 1.0.5. Before the recent update, the core was a few years out of date, around the 1.0 level.

To switch cores, it will be just a a matter of changing

644pa16m.build.core=arduino

to

644pa16m.build.core=mighty-1284p-1.0.5:mighty

in the Microduino boards.txt file.

To download the new "mighty-1284p" core, the GitHub link is here.

@The boards aren't showing properly under 1.5.6? All boards, or just the Microduino boards?
Just the Microduino boards. have checked with - show package contents.
Another Q
With the 644 are the SDA/SCL handled differently? as my mpu6040 doesnt start?

Randcook:
@The boards aren't showing properly under 1.5.6? All boards, or just the Microduino boards?
Just the Microduino boards. have checked with - show package contents.

Don't know enough off-hand about 1.5.6 to provide much guidance here, sorry.

Randcook:
Another Q
With the 644 are the SDA/SCL handled differently? as my mpu6040 doesnt start?

Yes, the SDA/SCL are on their own dedicated pins on the 644 family, whereas they are aliased as e.g. A4 and A5 on the 328p chip.

Having a quick look at the pins_arduino.h for the "plus" variants, I can see they've mapped SDA as D20 and SCL as D21 (at least according to their diagram...) it looks like they're using the "Calunium" mapping, which is a bit off the beaten track.

Anyway, I'd give D20 and D21 a go and see how that works in your sketch.

@pico,
If this is tedious just say.
Interrupts ?.

On Uno/Mega Interrupt 0 is on D2.

Q.
Are the 644 interrupts mapped the same.
Scanned the pins_arduino.h ... variants, but now on the limits of my Old grey cells.

Randcook:
@pico,
If this is tedious just say.

No, of course, not. :slight_smile: But thanks for the consideration! (You’d be surprised how many people never even say “thanks”.)

Randcook:
Interrupts ?.
http://arduino.cc/en/Reference/AttachInterrupt
On Uno/Mega Interrupt 0 is on D2.

Q.
Are the 644 interrupts mapped the same.
Scanned the pins_arduino.h … variants, but now on the limits of my Old grey cells.

You are right, it does depend on the pin mapping whether D2 is mapped to the hardware pin that corresponds to INT0.

For the “Calunium” mapping they are are showing in the pins_arduino.h in the “plus” directory, we can see that the D2 is mapped to physical pin PD2, which is also INT0 for the 1284p.

// ATMEL ATMEGA1284P on Calunium, PCB version
//
//                       +---\/---+
//           (D 4) PB0 1 |        | 40 PA0 (D 31) AI 7
//           (D 5) PB1 2 |        | 39 PA1 (D 30) AI 6
//      INT2 (D 6) PB2 3 |        | 38 PA2 (D 29) AI 5
//       PWM (D 7) PB3 4 |        | 37 PA3 (D 28) AI 4
//   PWM/SS (D 10) PB4 5 |        | 36 PA4 (D 27) AI 3
//     MOSI (D 11) PB5 6 |        | 35 PA5 (D 26) AI 2
// PWM/MISO (D 12) PB6 7 |        | 34 PA6 (D 25) AI 1
//  PWM/SCK (D 13) PB7 8 |        | 33 PA7 (D 24) AI 0
//                 RST 9 |        | 32 AREF
//                VCC 10 |        | 31 GND 
//                GND 11 |        | 30 AVCC
//              XTAL2 12 |        | 29 PC7 (D 14) 
//              XTAL1 13 |        | 28 PC6 (D 15) 
//      RX0 (D 0) PD0 14 |        | 27 PC5 (D 16) TDI
//      TX0 (D 1) PD1 15 |        | 26 PC4 (D 17) TDO
// INT0 RX1 (D 2) PD2 16 |        | 25 PC3 (D 18) TMS
// INT1 TX1 (D 3) PD3 17 |        | 24 PC2 (D 19) TCK
//     PWM (D 22) PD4 18 |        | 23 PC1 (D 20) SDA
//      PWM (D 9) PD5 19 |        | 22 PC0 (D 21) SCL
//      PWM (D 8) PD6 20 |        | 21 PD7 (D 23) PWM
//                       +--------+
//

BTW, the “Bobuino” pin_arduino.h file also maps D2 onto the same pin, so Skinny Bob will also have the INT0 pin on D2.

But for the “Bobuino”, the SDA and SCL pins are mapped to D23 and D22 respectively, instead of D20/D21 on the “Calunium” mapping.

In this case, to make your code portable, probably better to use “SDA” and and “SCL” to refer to the pins in your sketches, rather than “D21”/“D20”, etc., if that makes sense.

It’s possible to mix amd match variant pin mappings when programming your chips, so you could conceivably program the Microduino using the “Bobuino” mapping, for example, and the chip wouldn’t care… but some pins would be assigned different “logical” pin names, and so you’d have to be careful and understand the implications of the different mapping with respect to you sketch.

Here’s the “Bobuino” pin mapping, for your reference. You will notice it shares many, but not all, of the same pin mappings as the “Calunium” (Microduino+) shown above. Note, for example, D8 and D9 would be reversed. And the mappings for D14-D31 are all over the shop between the two. But you could at least partly finesse that by referring to some of those pins by their “functional” names, e.g., A0 - A7, SDA, SCL etc., upon which they generally agree.

I chose to go with the “Bobuino” mapping for my 1284p dev board (hence the “Bob” in the “Skinny Bob” name) because I felt, on balance, it was the most compatible mapping with respect to the standard Arduino Uno R3 shield header layout. Obviously less of an issue with the little Microduinos!

// ATMEL ATMEGA1284P on Bobuino
//
//                       +---\/---+
//           (D 4) PB0 1 |        | 40 PA0 (D 21) AI 7
//           (D 5) PB1 2 |        | 39 PA1 (D 20) AI 6
//      INT2 (D 6) PB2 3 |        | 38 PA2 (D 19) AI 5
//       PWM (D 7) PB3 4 |        | 37 PA3 (D 18) AI 4
//   PWM/SS (D 10) PB4 5 |        | 36 PA4 (D 17) AI 3
//     MOSI (D 11) PB5 6 |        | 35 PA5 (D 16) AI 2
// PWM/MISO (D 12) PB6 7 |        | 34 PA6 (D 15) AI 1
//  PWM/SCK (D 13) PB7 8 |        | 33 PA7 (D 14) AI 0
//                 RST 9 |        | 32 AREF
//                VCC 10 |        | 31 GND 
//                GND 11 |        | 30 AVCC
//              XTAL2 12 |        | 29 PC7 (D 29) 
//              XTAL1 13 |        | 28 PC6 (D 28) 
//      RX0 (D 0) PD0 14 |        | 27 PC5 (D 27) TDI
//      TX0 (D 1) PD1 15 |        | 26 PC4 (D 26) TDO
// INT0 RX1 (D 2) PD2 16 |        | 25 PC3 (D 25) TMS
// INT1 TX1 (D 3) PD3 17 |        | 24 PC2 (D 24) TCK
//     PWM (D 30) PD4 18 |        | 23 PC1 (D 23) SDA
//      PWM (D 8) PD5 19 |        | 22 PC0 (D 22) SCL
//      PWM (D 9) PD6 20 |        | 21 PD7 (D 31) PWM
//                       +--------+
//

BTW, did you get your “Skinny Bob” assembly instructions by email?

@pico
Got the docs OK.
Pin mapping
Have use D2 on mega Ok, but sketch doesnt run on 644, will try a bit more , else build the skinnybob.
Cheers
Peter

Randcook:
@pico
Got the docs OK.
Pin mapping
Have use D2 on mega Ok, but sketch doesnt run on 644, will try a bit more , else build the skinnybob.
Cheers
Peter

Also, try building with the alternative cores, as discussed above. I’d try

arduino:arduino

and

mighty-1284p-1.0.5:mighty

once you’ve downloaded the refreshed mighty core.