[EN] Arduino ADC/DAC

This article introduces the ESP32 and SAM-D21 microcontroller board to learn how to use ADC (Analog to Digital Converter) and DAC (Digital to Analog Converter) instruction by connecting the DAC pin to ADC as shown in Figures 1 (Connect A0 to A1 of Board SAM-D21 ) and 2 (Connect Pin GPIO26 to GPIO36 of ESP32) to send data to DAC and have ADC read it back. Then send the results out to the serial port for display with the Serial Plotter, which is an example program to send 3 types of data, which is a zigzag graph, triangular graph and waveform graph from the sinusoidal function

Figure 1 SAM-D21 with A0 connected to A1
Figure 2 ESP32 with port 26 connected to port 36
Read More

[TH] Arduino ADC/DAC

บทความนี้แนะนำบอร์ดไมโครคอนโทรลเลอร์ ESP32 และ SAM-D21 มาใช้งานเพื่อเรียนรู้การใช้คำสั่งเกี่ยวกับ ADC (Analog to Digital Converter) และ DAC (Digital to Analog Converter) ด้วยการเชื่อมต่อขา DAC เข้ากับ ADC ดังตัวอย่างภาพที่ 1 (เชื่อม A0 เข้า A1 ของบอร์ด SAM-D21) และ 2 (เชื่อมต่อขา GPIO26 เข้ากับ GPIO36 ของ ESP32) เพื่อส่งข้อมูลที่ไป DAC และให้ ADC อ่านค่ากลับเข้ามา และส่งผลลัพธ์ออกไปที่พอร์ตอนุกรมสำหรับแสดงผลด้วย Serial Plotter ซึ่งตัวอย่างโปรแกรมสั่งส่งข้อมูล 3 แบบ คือ กราฟแบบฟันปลา กราฟแบบสามเหลี่ยม และกราฟรูปคลื่นจากฟังก์ชันไซน์

ภาพที่ 1 บอร์ด SAM-D21 เชื่อมต่อขา A0 เข้ากับ A1
ภาพที่ 2 บอร์ด ESP32 ที่เชื่อมต่อขา 26 เข้ากับ 36
Read More

[TH] Cortex-M0+: SAMD21

บทความนี้แนะนำบอร์ดไมโครคอนโทรลเลอร์ที่ใช้ชิพ ATSAMD21G18 ของบริษัท Microchip ที่ใช้สถาปัตยกรรม ARM แบบ 32 บิต แกนตระกูล Cortex-M0+ ในรูปแบบบอร์ดตามตระกูล Arduino Uno ดังภาพที่ 1

ภาพที่ 1 บอร์ด SAMD21 ในฟอร์มของ Arduino Uno
Read More

[EN] Bare Metal Cortex-M Ep.1

This article is a series of programming articles focused on the Cortex-M0 via the STM32F030F4P6 or any other STM32 microcontroller based on CMSIS, an ARM firmware compiled from vivonomicon.com‘s series of Bare Metal: STM32 Programming articles without using the Arduino framework. In the article EP.1 is a matter of preparation. It consists of creating a link file to link different parts of the code together and the working part file. After that, the result file is uploaded into the microcontroller to complete the program development process.

(Figure. 1 STM32F030F4P6)
Read More

[TH] Bare Metal Cortex-M Ep.1

บทความนี้เป็นชุดบทความเขียนโปรแกรมที่มุ่งเน้นกับ Cortex-M0 ผ่านทาง STM32F030F4P6 หรือไมโครคอนโทรลเลอร์ STM32 รุ่นอื่น ๆ ในแบบที่ใช้ CMSIS ซึ่งเป็นเฟิร์มแวร์ (firmware) ของ ARM ที่เรียบเรียงจากชุดบทความ Bare Metal : STM32 Programming ของ vivonomicon.com โดยไม่ใช้เฟรมเวิร์กของ Arduino และในบทความตอนที่ 1 เป็นเรื่องของการเตรียมความพร้อม ประกอบด้วยการสร้างไฟล์ลิงค์สำหรับเชื่อมโยงส่วนต่าง ๆ ของโค้ดเข้าด้วยกัน และไฟล์ส่วนของการทำงาน หลังจากนั้นนำไฟล์ผลลัพธ์อัพโหลดเข้าไมโครคอนโทรลเลอร์เป็นการเสร็จสิ้นขั้นตอนการพัฒนาโปรแกรม

ภาพที่ 1 บอร์ด STM32F030F4P6
Read More