ARDUINO PROJECT: MEGA
Posted by kll on February 21 2013 23:02:25

a friend buy a MEGA 2010 from DF Robot DFR0003

so i can play with it and he want a default programming for it
for a house installation ( TIP DIMMER ...)


STEP 1.
plug in USB
FTDI... ( not search for microsoft..)
YOUR DEVICE IS READY TO USE
USB Serial Converter Ready to use
USB Serial Port (COM14) Ready to use

under Device Manager Ports (COM & LPT)
find
USB Serial Port (COM14)

STEP 2.
upload my blinktest incl. serial init OK
upload my DIMMER V02 OK

hardware data

Microcontroller ATmega1280
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 54 (of which 14 provide PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 128 KB of which 4 KB used by bootloader
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz

circuit


STEP 3.
here the code from a basic 12 channel tip dimmer

use following I/O

// CH_A PWM 2 Din 22
// CH_B PWM 3 Din 24
// CH_C PWM 4 Din 26
// CH_D PWM 5 Din 28
// CH_E PWM 6 Din 30
// CH_F PWM 7 Din 32
// CH_G PWM 8 Din 34
// CH_H PWM 9 Din 36
// CH_I PWM 10 Din 38
// CH_J PWM 11 Din 40
// CH_K PWM 12 Din 42
// CH_L PWM 13 Din 44

the inputs are with pull up, just need a push button to GND ( no switch )
i not used and fancy algorithm, each channel has its own code
timer, sinus ramp .. common