Skip to main content Skip to local navigation
Home » Category: 'c programming'

c programming

Zwei Blinkenlights

I'm doing some rapid "blinkenlights" prototypes for timer code today on the K32L2 board. The goal is to have two separate timers driving two LEDs using interrupt service routines. None of this code is optimized or ideal... I'm leveraging the NXP SDK and the examples that go with it for one Systick-driven LED and another […]

K32 Blinkenlights continued

Here we'll look at using the SysTick Timer to make the LEDs blink. The SysTick is a really basic timer found in ARM Cortex M0+ processors from all manufacturers. The SysTick will run an interrupt service routine that updates a global variable. That variable is used in the main loop to toggle the LEDs on […]

Blinkenlights on the K32L2

The K32 is another Cortex M0+ processor, similar to the ones that I've used in the past, like the KL25 and the K43. I'm using the K32 because it is supported, out of the box by the TinyUSB framework, which I want to leverage for MIDI music control. Typically, though, before we get started with […]

ESP32-C6: A RISC-V Microcontroller with JTAG on the USB

I'm more and more impressed by the selection of RISC-V processors out there. The ESP32 families of microcontrollers are found in some pretty impressive systems like M5Stack. The availability of WiFi and Bluetooth radios make them ideal development platforms for IoT. But here is a really cool thing. The ESP32-C6 RISC-V microcontroller has a single […]

Programming 8-bit PICs: which C standard?

Microcontrollers are usually programmed in C, a traditional programming language that dates back to the 1970s. Here I'll talk about a specific type of microcontroller family, the PIC16 (or PIC18) and the compiler options for it. XC8 supports C89, C90 and C99 (for PIC16/18) When programming an 8-bit PIC like a PIC16 or PIC18, it's […]

Floating Point Math Resources

For EECS 2021 students who are looking for additional resources on floating point math, here are some suggestions. Exercises with solutions: While we're at it, here is the Bit Fiddle app, by Tobias Stamm, a handy tool for converting between base 2, base 16 and base 10, as well as a twos-complement conversion page. Finally, […]

RISC-V on EECS Dept Computers: Compiling and Simulating

In this blog post I'm going to go through the steps for setting up a program for simulating basic RISC-V processors on computers in York University's EECS department. This should be helpful for undergraduate and graduate students, as well as faculty who want to use RISC-V in their research or courses. While we've been using […]

Spike Simulator for learning: C vs. Assembler

RISC-V processors, like ARM processors, are complex beasts, making them challenging to teach with. When teaching with them it's important to have appropriate development tools to reflect the immediate pedagogical goals but also to provide students with a pathway for further learning and application. When I teach courses on computer architecture, like EECS 2021 at […]

Getting Started with RISC-V: Spike Simulator

The Spike simulator is a command-line application for RISC-V development. It allows for both 32-bit and 64-bit simulations and supports multiple variants of RISC-V types. It's an alternative to using the Segger emSim simulator, which has both a graphical mode and a command line mode and. It's also more up-to-date and widely-used than the RVS […]

CLion & LibSerialPort

I've been itching to kick the tires on the CLion IDE to see how it works as a contemporary C and C++ development environment. I've been using Jetbrain's IntelliJ IDE ever since my student,Richard Robinson, recommended it to me for Java development. I typically write C programs using embedded IDEs like MCUXpresso, Segger Embedded Studio […]