Developed By:
- Adam Pietrewicz
- Hooman Keshvari
A repository for Embedded Linux course projects for the DE1-SoC Development Board.
- User-level and kernel-level programming in Linux
- Memory-mapped I/O with FPGA peripherals
- Handling hardware interrupts in the Linux kernel
- Writing Makefiles and building kernel modules
- Real-time embedded system design concepts
- Linux user-level C program that displays a scrolling message on the 7-segment display and terminal
- Pushbutton keys are used to pause/resume scrolling
- Communicate with SoC hardware through memory-mapped IO
- A kernel module that displays a real-time clock in the format MM:SS:DD on the 7-segment display and terminal
- Uses FPGA hardware timer register interface to generate periodic interrupts for clock
- A kernel module that acts as a countdown stopwatch displayed as MM:SS:DD
- Can set start time using switches and pushbuttons
- Supports starting, pausing, and resetting the stopwatch via pushbutton interrupts
- Implemented a simple character device driver (chardev) as a Linux kernel module
- Supports read and write operations via /dev/chardev, allowing user programs to modify and retrieve a message
- Created kernel modules providing /dev/KEY and /dev/SW interfaces
- Drivers read the states of DE1-SoC pushbuttons (KEY) and slider switches (SW) and returned their values to the user as ASCII-encoded data
- Developed drivers for controlling LEDs (/dev/LEDR) and 7-segment displays (/dev/HEX)
- Drivers accepted ASCII-encoded input from the user to display patterns and values on the hardware
- Wrote a C user-space program to integrate all drivers
- When a KEY was pressed, the current state of the SW switches was displayed on the LEDR lights, and the accumulated total was shown on the HEX displays
- Implemented a basic stopwatch driver supporting open, release, and read operations
- Displays stopwatch time in terminal via cat /dev/stopwatch
- Extended the driver to support write operations, enabling commands:
- run / stop — start or pause stopwatch
- MM:SS:DD — set stopwatch time
- disp / nodisp — enable/disable seven-segment display output
- Developed a user-level C program to interact with the stopwatch driver
- Program runs in an endless loop, responding to hardware inputs:
- KEY0: toggles between run and pause
- KEY1–KEY3: set stopwatch time parts (MM, SS, DD) using SW switches
- SW switches: specify the time values
- Read input from KEY and SW device drivers, and optionally displayed SW values on LEDs
- A user-level C program that turns the stopwatch into a timed math quiz game
- Presents a series of math questions to answer before time runs out
- Tracks and reports statistics at the end (questions answered, average response time)
- Optionally displays stopwatch on seven-segment display during the game
- Used VT100 commands to send ASCII escape sequences to the Linux terminal to clear the screen, and draw colored characters at specific positions
- Implemented Bresenham’s algorithm in C to draw straight lines between two points on the terminal
- Extended the program to create a moving horizontal line that bounces vertically
- Implemented basic collision detection with the top and bottom edges of the screen
- Extended the animation to include multiple objects moving and bouncing off screen edges
- Connected moving objects with lines to form a dynamic “chain"
- Used random initial positions and directions for variety
- Enhanced the Part 4 animation to respond to hardware inputs (KEYs and SW switches) in live-time to:
- Adjust animation speed up/down
- Increase/decrease the number of animated objects
- Toggle drawing of connecting lines on/off
- Implemented a Linux character device driver (/dev/video) to interface with the VGA display to:
- Clear the screen
- Set individual pixel colours
- Extended the driver with a line drawing command (Bresenham’s algorithm)
- Reduced overhead by moving line computation into the driver rather than issuing many pixel commands
- Added support for VGA vertical synchronization (sync command) to avoid tearing during animations by performing pixel buffer swapping
- Developed a user-space program to animate a horizontal line bouncing between the top and bottom of the screen
- Enhanced the driver to support drawing boxes of any specified length
- Wrote a user-level program that animates eight bouncing rectangles, connected by lines to form a moving chain
- Implemented double-buffering for smooth animations without flickering by storing pixel buffers in FPGA on-chip memory and SDRAM
- Added user interaction to control the animation using pushbuttons and switches in real time to:
- Adjust animation speed
- Increase/decrease the number of rectangles
- Toggle lines between rectangles on/off
- Extended the driver to work with the VGA character buffer to display a frame counter in the corner of the screen
- Added commands to:
- Erase text from the screen
- Display ASCII text at specified screen coordinates
- A user level program that configures the accelerometer, and prints real-time X, Y, Z acceleration values while tilting the board using virtual addresses to access the chip via memory-mapped I/O
- Developed a character device driver for the ADXL345 to add support to the Linux kernel for accessing the device
- Created /dev/accel device file to allow user-space access to accelerometer data
- Extended the character device driver to handle write commands such as:
- init: re-initializes the device
- calibrate: runs calibration routine
- format F G: sets resolution & range
- Implemented a user-space program with a graphical demo that displays a “bubble” that moves based on board tilt
- Supported smoothing of acceleration readings using a running average to reduce jitter
- Enhanced the driver to detect tap and double-tap gestures using the ADXL345’s interrupt capabilities
- Wrote a Linux user-level C program that generates and plays the middle C chromatic scale through the audio-out port of the DE1-SoC Computer system
- Used memory-mapped I/O to write samples to the DE1-SoC audio CODEC via the audio port registers
- Extended the program to play multiple tones (chords) simultaneously (without volume overflow) based on a 13-character command-line input
- Created a multithreaded digital piano that responds to USB keyboard input in real-time
- Used Pthreads to separate audio generation and input handling, improving responsiveness and timing accuracy
- Added a third thread to display the currently played sound waveforms on the VGA screen using character device drivers to communicate with the VGA controller
- Implemented a feature to record and play back sequences of notes, tracking piano key press/release timings
- Used the stopwatch and pushbuttons/LEDs to control and indicate recording/playback status
- Modified the program to use the Linux character device driver interface (/dev/IntelFPGAUP/audio) instead of memory-mapped I/O for audio output
- C program that reads from the DE1-SoC ADC (AD7928) controller port registers and prints the voltage level of the ADC connector pin to the terminal
- Developed a Linux kernel module that generates a configurable square wave on pin D0 of the JP1 connector of the DE1-SoC
- Used FPGA Timer0 to generate periodic interrupts and toggle the output pin at a frequency set by board switches (10–160 Hz)
- Displayed the selected frequency and switch settings on LEDs and seven-segment displays
- Wrote a C program that implements an oscilloscope that samples ADC channel 0 periodically and displays the waveform on the VGA screen
- Triggered sweeps on rising or falling edges of the input signal based on switch SW0
- Enhanced the oscilloscope to allow the user to adjust the sweep duration using the board’s KEY buttons (increase/decrease by 100 ms increments)
- Developed an implementation of the Canny Edge Detection Algorithm in C which includes: grayscale conversion, Sobel operator, non-max suppresison and hysteresis
- tested edge detection on BMP images and visualized results using VGA display
- Reconfigured the FPGA with a hardware edge-detection system
- Wrote C function to properly pack 24-bit pixels into 32-bit SDRAM memory
- Implemented flip() that flips the image vertically before writing it into the SDRAM buffer so it appears correctly on the video output
- Extended the Part 2 code to enable and control the FPGA’s hardware edge-detection pipeline
- Used DMA controllers and their registers to:
- Stream image data to and from the FPGA-based edge-detection circuit
- Swap buffer addresses and wait for completion using status polling
- Display the edge-detected output on the VGA monitor
- Saved the hardware-processed edge-detected image back to a BMP file
- Compared the hardware-accelerated runtime against the CPU-only implementation to evaluate performance improvements
