(SKU:RB-01C009)Carduino mega328 Controller(B)

From ALSRobot-Wki
Jump to: navigation, search
233.jpg

Contents

Product overview

Carduino mega328 controller is Carduino UNO concise miniature version of the controller, can be put on the bread board, size suitable for demanding applications. Carduino mega328 controller core processor is ATmega328, at the same time, with 14 digital input/output (including six road can be used as a PWM output), 8 analog input. Carduino mega328 controller must turn an external USB TTL module was able to download the program

specification

1.processor ATmega328
2.Working voltage 5V
3.Digital I/o 14 feet (including six road as a PWM output)
4.Analog input eight feet
5.Dc current that IO 40 mA
6.Flash Memory 32 KB (Including 2 KB for the bootloader) 7.SRAM 2 KB 8.EEPROM 1 KB
9.The clock work 16 MHz

Using the method and example program

Pin diagram

Carduino700.jpg

Functional specifications:
1.Pin number 0 to 13 to 14 road digital I/o port: working voltage is 5 v, each all the way to the output and access the maximum current is 40 ma.
2.Serial signal RX (0), TX: (1) provide TTL serial port receiving signal voltage level.
3.External interrupt (2 and 3) : raise the interrupt pin, can be set up along the falling edge, or trigger at the same time.
4.Pulse width modulation PWM (3, 5, 6, 9, 10 and 11) : provide 6 road 8 PWM output.
5.SPI (10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK)) : SPI communication interface.
6.Pin number 14 to 21 of 8 analog input: each all the way with the resolution of the 10) (i.e., there are 1024 different input values, the default input signal range is 0 to 5 v.
7.Reset:Signal for low reset microcontroller chip.
8.PWR:The power indicator light.

Program download method

As shown in figure, the USB to TTL module USES dupont lines to connect with mega328 control, which the DTR interface of USB to TTL module and controller on the DTR pin connection (next to the GND pin position).

Ttl328.jpg


The connection as shown, open the Arduino IDE, download a program version to select the UNO.
Note: the USB to TTL module need to install the corresponding driver in the computer, may be downloaded by baidu or ArduinoIDE Laos version of the controller driver can drive success, drive can be showed in the computer after the corresponding serial port, choose the serial port number when download is a serial port.

routine

We use Carduino mega328 controller to do an experiment, using the hardware is as follows:

  1. mega328
  2. USB-TTL
  3. big button module
  4. LED a small light module
  5. General 3 x 2 p sensor line
Ttl3282.jpg
As shown, the big button module in the controller number 2 mouth, small lights LED module in the controller number 13, the press of a button module, can be observed that destroy the light of LED small lights change.

sample program

int buttonPin = 2;
int ledPin =  13;     
int buttonState = 0;        
void setup() {
  pinMode(ledPin, OUTPUT);      
  pinMode(buttonPin, INPUT);     
}

void loop(){
  buttonState = digitalRead(buttonPin);
  if (buttonState == LOW) {       
    digitalWrite(ledPin, HIGH);  
  } 
  else {
    digitalWrite(ledPin, LOW); 
  }
}

Application effect

After the big button is pressed module, LED lights up; When the big button module to loosen, LED lights went out.

Products related to recommend

Buy address:Carduino mega328(A version)
Buy address:Arduino Mini USB adapter

Personal tools
Namespaces

Variants
Actions
Navigation
Tools