กลับไปหน้ารวมไฟล์
miccon-vm-with-shell-and-translator-113cdf.md

MicCon (VM พร้อม Shell และตัวแปลภาษา)

MicCon

MicConOS มันคือระบบ Virtual Machine (VM) สำหรับบอร์ดตัวแรงอย่าง [Arduino](https://s.shopee.co.th/7fUgFAWSki) Due และ Arduino Mega ที่สามารถรันไฟล์ที่คอมไพล์มาเฉพาะทาง แถมยังทำงานร่วมกับ Hardware ต่างๆ ได้เพียบ ไม่ว่าจะเป็น SD, TFT, คีย์บอร์ด PS/2 หรือแม้แต่ RTC ก็จัดไปวัยรุ่น

ส่วน MicConAsm ก็คือตัว Translator หรือตัวแปลภาษาสำหรับ MicConOS (แปลงจากภาษาแนวๆ Assembly นั่นแหละน้อง)

ของที่ต้องเตรียม (Requirements)

MicConOS ต้องใช้ Library พวกนี้ด้วยนะ จัดการลงให้ครบ อย่าให้ขาด:

  • UTFT
  • PS2Keyboard
  • timer-api
  • SD
  • Library มาตรฐานจาก Arduino framework (พวก Wire.h, SPI.h, libc และอื่นๆ)

อุปกรณ์ที่รองรับ (Device Support)

  • Arduino Mega2560 (บอร์ดสามัญประจำบ้าน)
  • Arduino Due (ตัวแรงต้องมี)
  • SD cards (ต่อผ่าน SD & SPI Library)
  • RTC DS3231 (ต่อผ่าน Wire Library)
  • PS/2 Keyboard
  • [LCD](https://s.shopee.co.th/6AfsSPcAnb) TFT (ใช้งานผ่าน UTFT Library)

ตัวอย่างการใช้งาน (Examples)

น้องๆ สามารถเอาไฟล์ตัวอย่างจากโฟลเดอร์ /prog มาคอมไพล์ด้วย MicConAsm ได้เลย เสร็จแล้วก็ก๊อปไฟล์ *.bin ใส่ลงใน SD card แล้วสั่งรันด้วย io.bin หรือ 50.bin หล่อเท่เลยงานนี้

ข้อมูลเพิ่มเติม (Info)

คำอธิบายระบบแบบละเอียด ไปเปิดอ่านได้ใน paradigm.md นะน้อง

ส่วนตารางคำสั่งภาษา Assembly ไปส่องดูได้ที่ assembly_language.md เลย

สัญญาอนุญาต (License)

MicConOS กับ MicConAsm เป็นซอฟต์แวร์ Open-sourced แจกให้ใช้กันฟรีๆ ภายใต้สัญญา GNU GPL v3 นะครับวัยรุ่น

รายละเอียดเทคนิคแบบจัดเต็ม (EXPANDED TECHNICAL DETAILS)

สถาปัตยกรรมระบบ Embedded Virtual Machine

MicCon คือโปรเจกต์ซอฟต์แวร์ระดับ Advance ที่จำลองระบบ Virtual Machine (VM) และ "Command Shell" ลงไปบนบอร์ด Arduino แบบเพียวๆ

  • Translator/Byte-Code Kernel: โปรเจกต์นี้มีตัว "Translator" ที่จะเปลี่ยนภาษาสคริปต์ที่เราเขียนขึ้นมาเอง ให้กลายเป็น Byte-codes ขนาดจิ๋ว แล้วให้ Arduino อ่านโค้ดพวกนี้จาก Serial หรือ Memory เข้ามา "ประมวลผล (Execute)" บน Virtual Stack ของมันอีกที
  • Visual Studio 2015 Support Environment: ชุดเครื่องมือพัฒนา VM ตัวนี้สร้างขึ้นบน Visual Studio เลยนะน้อง ทำให้โค้ด C++ มันมีความเป็น Modular สูงมาก และจัดการ Memory ได้เทพสุดๆ เพราะเราต้องรีดประสิทธิภาพจาก RAM ที่มีแค่ 2KB ของ Arduino ให้คุ้มที่สุด (ห้ามทำช็อตนะตัวนี้!)
การโต้ตอบกับระบบ (Interaction)
  • Live Shell Debugging Interface: ตัวนี้เปิดโอกาสให้น้อง "คุย" กับ Arduino ได้โดยตรงผ่าน Serial Shell จะสั่งรันโปรแกรมหรือเช็กสถานะภายในเครื่องแบบ Real-time ก็จัดไป เหมือนเราสร้าง "Mini OS" เล็กๆ ไว้คุม Hardware เลยแหละน้อง สู้งานนะ!

ข้อมูล Frontmatter ดั้งเดิม

title: "MicCon (VM with shell and Translator)"
description: "I present to you a virtual machine with shell that can execute files compiled for it and work with hardware, such as SD, TFT, keyboard, RTC."
author: "evost"
category: "Lab Stuff"
tags:
  - "embedded"
  - "operating system"
  - "virtual machine"
  - "os"
  - "shell"
views: 6505
likes: 5
price: 2450
difficulty: "Intermediate"
components:
  - "1x Pmod PS2"
  - "36x Male/Female Jumper Wires"
  - "1x TFT LCD supported by UTFT.lib"
  - "2x 3.6V 0.5W Zener Diode"
  - "1x PlatformIO"
  - "1x Arduino Due"
  - "1x DS3231MPMB1 Peripheral Module"
  - "1x Pmod SD"
tools: []
apps:
  - "1x Visual Studio 2015"
  - "1x Arduino IDE"
downloadableFiles:
  - "https://github.com/evost/MicCon"
  - "https://github.com/evost/MicCon"
documentationLinks: []
passwordHash: "c1b14c11080ccd0f0d83fbf5931ef5f698531e8501df3bf0479f07bd08bdabe2"
encryptedPayload: "U2FsdGVkX191AQa8+3ElQ7Q1hrxlRqCQUx5wH5Lr/nFB19Keb796QvyWR3/IDjyehtQi4z3IOxLGKN7q375w6UA2l1sNdIdf5HWFH4bEkqaEczNe4Z6UK47wCmoKRvxR"
seoDescription: "MicCon: A VM with shell for Arduino to execute compiled files and interface with hardware like SD, TFT, keyboard, and RTC."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/miccon-vm-with-shell-and-translator-113cdf_cover.jpg"
lang: "th"