redesigned ArduinoBT with a 8Mhz oscillator

Hello all !

We have redesigned an ArduinoBT board in order to have a smaller card. We also have changed the oscilaltor to an 8Mhz oscillator, the chip is still an ATMega168. (We use a lower voltage ....)

I had a sketch perfectly working with the "classical ArduinoBT".

I now have a few questions:

  • Because of the 8Mhz oscillator (instead of 16 in the classical ArduinoBT), I think I have to change something in the arduino libraries and recompile all of it ? Is that right ?

subQuestion: Under windows, what program should I use to recompile all the libraries ? I have seen in the Arduino folder: "arduino/hardware/core/arduino" a makefile. Sould i make this makefile with a program such as minGW ? (whith a different F_CPU value ?)

  • Can I upload my sketch directly to the new board with an AVRISP mk2 ? if yes, how ? (can't obtain any .hex file out of my sketch ...) Or should I buirn the bootloader and then try to use the classical bluetooth upload mode for my sketch ?

Hope it was clear enough ! Thanks !

Under all platforms, the directions you need are here:

The libraries are always compiled when you compile your sketch, so you won't need to recompile anything, whether on Windows or another platform. For more info, though, check with David Mellis, who added the support for third party hardware in 0018.

Thanks for your quick reply !

Sorry to develop ... but I would need some more precisions

So if I understood correctly:

I have my .pde file in the folder "lightSwitchMux"

I have to add a subfolder "hardware" at the root of this folder (which is the sketchbook folder) and copy the folders "bootloaders", "cores" , and the 2 files "boards" and "programmers" in "hardware" folder. Those files/folders are copied from "ArduinoFolder/hardware/arduino"

Then I can change what I want from those files and when I compile from processing it will automatically take those files. Because I tried ... and it seems to work only if I modify the files located in "ArduinoFolder/hardware/arduino/"

Then for my case:

As more or less only the cpu speed has been changed:

I should only change in the file "boards" the line '' to ''

And It should be enough .. ?

Another quick question:

  • Can I use the file name 'LightSwitchMux.cpp.hex' produced when compiling and contained in the subfolder '/applet' to upload directly with the AVRISP mk2 with avrstudio ? --> Strange, when I compiled, it used to produced this folder "applet" with all the .o files and alsdo the .cpp.hex ... Does not do it anymore now ... I don't get it ... any clue why ?

thanks a lot ! I know, that makes many questions in 1 thread ... sry

So …

After digging a bit I found a few things:

  • Seems to me I have to modify the files in the arduinoFolder to modify the compiled program. (vs the sketchbook folder)

  • With windows7, the .hex files are outputted in a hidden folder. Located here: C:\Users\username\AppData\Local\Temp\build8171277836735465602.tmp

  • I was unable to upload directly through processing and AVRISP mkII (could not detect the usb thing of the mkII, probably driver problems), I had to use AVR Studio and upload the .hex directly from here.

So it is easy to program the ArduinoBT like that ! Even easier than through Bluetooth. (No timer problem …)

Still when I try to upload to the new board (having added a new card name BT 8Mhz in the “board.txt with a F_CPU oh 8000000L instead of 16”). It does not work as planned … still looking into that problem !

So maybe I have to change more things … by the way, the Bluetooth module seems not to be working neither with the redesigned card …

Cheers …