8MHz-Version of DmxSimple

246 views
Skip to first unread message

Scruff

unread,
Dec 16, 2009, 8:50:12 AM12/16/09
to DmxSimple
Hi Peter,

I've moved on with my Teensyduino-Bluetooth-DMX-Board and it works
perfect.
So my next step would be to reduce hardware.
At the moment I use a 5V AT90USB646 board and some transistors, a
voltage regulator and some resistors to hook that up to my BTM222
Bluetooth module which only works at 3.3V. So I'd like to move to a
ATMEGA32U driven at 3.3V. But for that I'd have to reduce CPU-Clock,
which in turn would most likely send DmxSimple timing down the drain.
Since you have worked out the timing down to each clock cycle, I'd
like to ask if you see any possibility to strip down that code to also
work at 8MHz.

Thanks

Andy

Peter Knight

unread,
Dec 16, 2009, 9:12:42 AM12/16/09
to DmxSimple
Have you tried it yet? It should work.

DmxSimple calculates the timing loops at compile time for the given
clock frequency, provided:
a) the frequency 4MHz or above,
b) the frequency is whole number of MHz, and
c) the CPU has the same instruction timings as the ATmega*8 series.

The timing loops pick up on the F_CPU define, which is a standard
feature of AVR-GCC. (It is used a lot in the delay.h part of the
library)

For using the Arduino IDE, F_CPU is set in hardware/boards.txt as the
xxxx.build.f_cpu option. Provided boards.txt is correctly modified,
you'll be fine.

If you're doing a command line based custom build, check you set the -
D F_CPU value correctly in gcc.

Bear in mind that if you're using 3.3V rails, there could be issues
with driving valid DMX voltages. Check the specs for your driver chip
- you might still need a 5V rail.


Peter


On Dec 16, 1:50 pm, Scruff <scruf...@sbg.at> wrote:
> ...

Scruff

unread,
Dec 16, 2009, 9:19:59 AM12/16/09
to DmxSimple
Thanks Peter,

for that quick response.
No, I have to admit I haven't tried it yet, but after your reassuring
reply I'll be doing that as soon as possible.

Thanks again

Andy
Reply all
Reply to author
Forward
0 new messages