Table of Contents

CFMEGA2

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

View at our online store.

MCU Details

Device Details

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. Additional logic is required to convert the raw digital value (0~1024) to units like milliamps or voltage.

void setup() {
 Serial.begin(9600);
}
void loop() {
 int current_raw_value = analogRead(A0);
 int voltage_raw_value = analogRead(A5);
 
 Serial.print(" Current Raw Value = "); Serial.print(current_raw_value ) ; Serial.print("\r\n" );
 Serial.print(" Voltage Raw Value = "); Serial.print(voltage_raw_value ); Serial.print("\r\n" );
 delay(200);
}

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

 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);
 }
}

Power Supply

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.