Sanguino + DAC + RTC + Altoids

I just finished a prototype for a new board I am
working on -- NB2A which is ATmega644P,
DS1337 RTC and a TLV5618 DAC in an Altoids
form factor.

I used the Arduino+Sanguino setup and my RTC
and DAC libraries to write a couple '644 apps.

The DAC and RTC applications are listed in the
"Applications Hints" section at Loading...
The sparsely doxygenated documentation is
under the "Libraries" section.

(* jcl *)

Cool.
I am wondering: do you need to adapt some libraries (those containing Serial, millis etc) for the 12MHz clock?
How much?

Why a 12MHz clock? Did I miss something? I used a 16MHz clock with the Sanguino board I built and it seems to run fine.

Nice board, BTW. The Altoids form factor is a great idea.

Cool.

Thanks.

I am wondering: do you need to adapt some libraries (those containing Serial, millis etc) for the 12MHz clock?How much?

I changed the frequency definition in the Makefile for the bootloader and in the
boards.txt file. No changes are required anywhere else.

All of the Sanguino stuff I tried just worked. Both the Arduino and Sanguino teams
have done a nice job.

(* jcl *)

Why a 12MHz clock? Did I miss something? I used a 16MHz clock with the Sanguino board I built and it seems to run fine.

I run the board at 3.3V so I use a lower frequency.

Nice board, BTW. The Altoids form factor is a great idea.

Thanks. I will have pictures of the Li-ion charger that fits underneath shortly.

(* jcl *)

I changed the frequency definition in the Makefile for the bootloader and in the boards.txt file. No changes are required anywhere else.

There is a caveat to that statement - Although libraries usually use the CPU frequency definition to handle frequency dependent code, this does not necessarily mean they will all work at 12mhz. for example, if the code assumes that the cpu clock is evenly divisible by 8 then it can break when running at 12 mhz (the Arduino millis and delay functions had that problem up until recently).

So although all the Arduino core functions should work, it is possible that some third party code could have a problem with 12mhz.

So although all the Arduino core functions should work, it is possible that some third party code could have a problem with 12mhz.

Any ideas which libraries to watch out for?

Seems like it should be easy to fix.

(* jcl *)

One example off the top of my head is NewSoftSerial,
see: NewSoftSerial | Arduiniana

I think it assumes the CPU clock is either 8MHz or 16MHz.
Adding support for 12MHz is probably doable but not trivial.

One example off the top of my head is NewSoftSerial,
see: NewSoftSerial | Arduiniana

I think it assumes the CPU clock is either 8MHz or 16MHz.
Adding support for 12MHz is probably doable but not trivial.

Thanks for the input.

I took a quick look at the NewSoftSerial. It doesn't seem like it would be too difficult
to fix (could be famous last words ;)). If I run out of UARTs on the 644P (which could be as early as the next project ;)) I may fix it.

(* jcl *)

You may want to ask the author, Mikal Hart (username=mikalhart) for advice in tuning the parameters. BTW, in deference to Mikal, it's not broken – his software does what it is documented to do. There has been no need for Arduino software to run at speeds other than 8 and 16 MHz and that's why one shouldn't be surprised if there is code out there that doesn't work at other clock rates.

BTW, in deference to Mikal, it's not broken – his software does what it is documented to do.

I didn't mean to imply that the software was defective.

I took a quick look at the NewSoftSerial.
It doesn't seem like it would be too difficult to fix extend.

(* jcl *)