Skip to content
View MageMCU's full-sized avatar

Block or report MageMCU

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
MageMCU/README.md

About MageMCU

--- Blinking LED ---

The Hello World cliche is still blinking... Hello, I'm Jesse. I've been fascinated by the magic of modern tech. My interest is programming the AVR which is a family of microcontrollers (MCU) developed by Atmel, acquired by Microchip.

The two wheeled differential drive mobile robot

I did put together a rudimentary robot to study the interfacing and programming the MCU. Yet, there are many inexpensive two wheeled differential drive mobile robots (DDMR) on sale. Google the keywords Arduino Differential Drive Mobile Robot and then select the Google tab Shopping... The MageMCU repositories have experimental software that will work on these robots: two-wheels with caster, 4-wheels or tracks. The brains for the DDMR is the most used and popular Arduino Uno Rev3 board (UNO).

Atmega328P

At the heart of the UNO is the Atmega328P-PU (atmega328p) MCU. The 28-pin DIP package is easily replaced if damaged. Furthermore the UNO board with the atmega328p chip removed can be used as a programmer.

  • The Arduino to a Microcontroller on a Breadboard Uploading a Sketch Using an Arduino Board
    • Remove the atmega328p chip from the UNO in order to use the UNO as a programmer...
  • See datasheet (pdf file) for the Atmega328P...

Note that Bootloader below clarifies and exemplifies the one described here...

Atmega16U2

The Atmega16U2 chip on the Arduino Uno board acts as a bridge between the computer's USB port and the MCU serial port.

Bootloader

  • Burn the bootloader on UNO...
    • UNO R3
      • UNO R3 Schematic
        • Notice where in the schematic the TX-RX and the RX-TX connections cross between the atmega16u2 and the atmega328p. The wiring in a serial communication is connected such that the TX of one device like the atmega16u2 is connected to the RX of the other device like the atmega328p, and its RX is connected to the TX. Do not forget to connect the ground (GND) wire amoung all devices used...
  • Arduino as ISP for Arduino Bootloaders

AVR Programming

Bare Metal Programming

Make utility

  • Study the AVR Tool Chain - Essential Guide used for Makefile - Standard C library for AVR-GCC
  • Using make and writing Makefiles
    • When writing a MakeFile that uses avr-gcc, avr-objcopy and avrdude, Google search the keywords: Makefile mFile Atmega328P Github. Learning how to use these MakeFile templates is a great way to understand the AVR Tool Chain.
      • Use the following make example as a guide while studying the AVR Tool Chain. Save a copy and expand those sections with additional comments (#) with a better description...

Programming Language

  • The procedural C prograomming language is used by beginners and then move to object-oriented programming (OOP), the C++ programming language.
  • Programming: Principles and Practice Using C++, 2nd Edition - (Pearson - Learning. For life.)
  • International Organization for Standardization (ISO) & Resources - source
  • C++ Reference - source
    • Standard Library Headers
      • This is the reference for the Raspberry Pi...
      • Archives for offline viewing - source Use the HTML ZIP file
    • Be carefull when using the Standard (STD) Library with Arduino Boards.
      • Use the Arduino Documentation instead of the STD Lib...
      • Arduino Docs - In the left column, select Language Reference
        • Functions
        • Variables
          • Data Types - Here you'll find string and String()
        • Structure
  • The reasoning behind the repository publication is to further my studies in the C++ programming language to include C++ templates along with C++ meta programming. Many in the industry would narrow the modern C++ language down by encapsulating it into a singularity called abstraction. Unfortunately, many like myself where the modern C++ abstraction is difficult to grasp.

Computers

  • The Arduino integrated development environment (IDE) is a cross-platform application (for Microsoft Windows, macOS, and Linux operating systems)...
  • Many older computers may be made to use a Linux operating system like Ubuntu which is recommended when connecting electronic circuits by USB because electrostatic discharge (ESD) may occur when the flow of electricity is interrupted along the circuit. For example, the data acquisition to your computer from a circuit running dc motors may well blow the USB circuit on the computer.
  • The new Raspberry Pi 5 (Pi5) and its operating system is an inexpensive linux platform that is often used with the Arduino IDE. The Pi5 with 8GB has plenty of memory and processing power to run the Arduino IDE 2, VSCode with PlatformIO without any issues. If an ESD occurs on the Pi5 USB, the Pi5 can be replaced at a low cost...
    • This is what the author uses for AVR programming.

Libraries

Lab Notebook: Science - Physics - Chemistry - Engineering - Electronics - Robotics

Electronics Textbook

  • Introductory Circuit Analysis author Robert L. Boylestad, 13th and now the new 14th edition
  • Laboratory Manual for Introductory Circuit Analysis, 13th edition

Electronics Courses

DIY Beginners Electronics Desktop Lab

BUG FIXES

  • In the Joystick.h file, the algorithm uses abs() function but it uses the (int) integer type instead of a float...
    • Has yet to be incorporated into the older repositories...
    • I caught this while coding - Wireless Communication - nRF24L01
    • As of 20240813, the code was added to MiscMath.h. See all header revisions in the include folder in both the Wireless Communication and the Joystick Uno L298N repositories.
   template <typename T>
    T absT(T val)
    {
        T zero = (T)0;
        if (val < zero)
            val *= (T)-1;
        return val;
    }
  • The Joystick Uno L298N repository has been updated with this fix. Other issues including expanding the L298N Bits() function from eight (8) to sixteen (16) combinations which finishes with the Motor Movement Checklist (MMC). The article 1009 - L298N Supplemental has been updated with more informtion in how to use the L298N Bits() function along with the MMC.

Tentative Disclaimer

  • Any products, services, and/or mediums like youtube videos described here on the MageMCU Github Account are considered unintentional and purely coincidental promotions and thereby to make clear any idea of such promotions should be interpreted solely as intended for the use for educational purposes only...
  • BUYER BEWARE - this Github account uses links to Amazon marked as Å that reflects parts used. Transparency at this Github account is imperative. All issues related to Å products should be directed to Å.
  • The MageMCU Github account is actively hacking away on experimental code for the Arduino Uno Rev3. This includes testing and updating the software. Keep it simple.
  • This page is meant for the author and belays with the author. If anyone disagrees with its content, please contact the author...
  • Please follow the Disclaimers and Terms in each of the repositories including the Disclaimers and Terms by Github.
  • MageMCU repository revised 20241014

Popular repositories Loading

  1. Joystick-Uno-L298N Joystick-Uno-L298N Public

    This is an electronics lab for experimenting with a pair of wheeled DC motors used in differential drive mobile robot using the following hardware, the Arduino Uno, the Thumb Joystick and the Motor…

    C++ 2 1

  2. MageMCU MageMCU Public

  3. Flysky_FS-i6X_FS-iA6B_Testing Flysky_FS-i6X_FS-iA6B_Testing Public archive

    This electronics lab is not complete but all good experiments take time. Active Project...

    C++

  4. Numerics Numerics Public

    An algebra library titled Numerics used for both the Arduino and Raspberry Pi platforms. The library includes Vectors, Matrices and Quaternions. This is an active project.

    C++

  5. FSM FSM Public

    A finite state machine (FSM) is a coded abstract machine that only has one action or state at a time. The machine transitions from one state to another if there are inputs that triggers the state c…

    C++

  6. PID-Controller PID-Controller Public

    A proportional–integral–derivative controller (PID controller) is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications r…

    C++