User Tools

Site Tools

한국어

modularfaduino:cfmega2

CFMEGA2

This is an Arduino Mega compatible CPU module. It is designed to be used for GPIO, communication, ADC, NTC (temperature), etc.

  • The CPU module must be located on the far left. Connect the I/O module to the right.
  • Up to 16 I/O modules can be connected to one CPU module.

MCU Details

  • MCU: ATMega2560
  • Program memory: 256KB
  • SRAM memory: 8KB
  • EEPROM: 4KB

Device Details

  • Power supply: DC 12~24V1)
  • CPU module current consumption: 0.5W
  • Communication: CH1 : RS232C, CH2 : RS232C, CH3 : RS485
  • I2C : 1 (Can connect QWIIC Modules)
  • GPIO: 8 (7 x PWM) 5V input/output
  • INT : 2 (External Interrupt Input, 5V input)
  • ADC: 8 (0~20mA - 4 channels, 0~10VDC - 4 channels)
  • STATUS LED : 13=LED, 22=RUN, 23=ERROR
  • Temperature: 1 (NTC, measurement range -40~99℃, error +/- 1 degree)

Description of each part

* What is QWIIC? This is a product line of Arduino I2C peripherals sold by Sparkfun, USA. Reference link

About GPIO

The GPIO port is a port that can be used for 5V input/output or PWM output. In fact, it is the same as the I/O terminal on a regular Arduino. However, a TVS diode for surge blocking is installed internally.

About RS485 (Channel 3)

The RS485 port assigned to Channel 3 is a port that uses the MAX13487 chip, which automatically switches the transmission and reception directions. Therefore, there is no need for users to handle sending/receiving directly.

About Power Connection

Please connect a voltage between DC12 and 24V into one of the DC jack and terminal blocks. Determine the power capacity according to the total number of connected I/O modules. If there are less than five, 24V 1A is suitable. If it is more than that, choose a larger capacity.

Example program

- LED blinking : This is a program that blinks the LED.

const int StatusLED = 13;
void setup() {
 pinMode(StatusLED, OUTPUT);
}
void loop() {
 digitalWrite(StatusLED, HIGH);
 delay(1000);
 digitalWrite(StatusLED, LOW);
 delay(1000);
}

- ADC analog input: This is a program that receives current/voltage input.

void setup() {
 Serial.begin(9600);
}
void loop() {
 int ADI_mA = analogRead(A0);
 int ADI_DCV = analogRead(A5);
 
 Serial.print(" ADC_mA = "); Serial.print(ADI_mA) ; Serial.print("\r\n" );
 Serial.print(" ADC_DCV = "); Serial.print(ADI_DCV); Serial.print("\r\n" );
 delay(200);
}

- NTC Temperature: NTC temperature measurement program. (Measurement range -40 ~ 99℃ / error +/-1 degree)

  • Use after registering “CFMEGA.h” library
  • Read temperature value with ntcRead_a4() command
  • NTC sensor sold separately
 int16_t ntcRead_a4(void);
#include "CFMEGA.h"
void setup() {
 Serial.begin(9600);
}
void loop() {
 int NTC_a4 = ntcRead_a4();
 Serial.print(" TEMP = "); Serial.print(NTC_a4) ; Serial.print("\r\n" );
 delay(1000);
}

- RS232 communication: Eco communication program for channel 1 (Tx1, Rx1).

void setup() {
 Serial.begin(9600);
 Serial1.begin(9600);
}
void loop() {
 if (Serial1.available() > 0) {
 char rx_Byte = Serial1.read();
 Serial.print("I received: ");
 Serial.print(rx_Byte);
 
 Serial1.print(rx_Byte);
 }
}

Technical Support Policy

If the total number of connected modules is 8 or less, a 24V, 1A SMPS is suitable. If the total number is 8 or more, use a 24V, 2A SMPS.

Modular FADUINO

1)
The capacity of the power supply connected here must be at least twice as large as the sum of the current consumption of all connected modules.
modularfaduino/cfmega2.txt · Last modified: 2024/08/25 10:21 by COMFILE Technology