Skip to content

Instantly share code, notes, and snippets.

View ajarmst's full-sized avatar

AJ Armstrong ajarmst

  • Northern Alberta Institute of Technology
  • Edmonton, Canada
View GitHub Profile
/////////////////////////////////////////////////////////////////////////////
// Basic HC9S12 Output Compare Timer Functionality
/////////////////////////////////////////////////////////////////////////////
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include "pll.h"
#include "swled.h"
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 01 - GPIO
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL) (initially disabled)
// Author: AJ Armstrong
// Details: Fork of ICA 01 for GPIO Demonstration
// Date: 25 Jan 2022
// Revision History :
// 20210129.0 - Initial port of code from ICA 02
// 20210129.1 - First use of code for live demonstration
@ajarmst
ajarmst / Demo11.c
Last active December 13, 2021 15:56
I2C Demo Using a DAC
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 10 - SPI DAC
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Connect and control an MCP4812 DAC via SPI.
// Date: 25 Oct 2021
// Revision History :
/////////////////////////////////////////////////////////////////////////////
@ajarmst
ajarmst / Demo09.c
Last active November 20, 2021 19:24
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 9 - ADC
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Trivial ADC Voltmeter on ADC0 (Pin 67)
// Date: 25 Oct 2021
// Revision History :
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 8 - Serial Interrupts
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Demonstrates basic SCI operation using the DB-9 connector
// using interrupts.
// Date: 25 Oct 2021
// Revision History :
/////////////////////////////////////////////////////////////////////////////
@ajarmst
ajarmst / Demo07.c
Last active November 20, 2021 19:05
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 7 - Serial Communications Interface
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Demonstrates basic SCI operation using the DB-9 connector
// using simple polling of the buffers.
// Date: 25 Oct 2021
// Revision History :
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 6 - Pulse Width Modulation
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Demonstrates timer interrupts using both a library config-
// uration, direct setup of a different timer, responding
// to Port J interrupts from on-board switches.
// Date: 15 Oct 2021
// Revision History :
@ajarmst
ajarmst / TimerDemo.c
Last active September 29, 2021 17:51
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 5 - Timer and Port J Interrupts
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Demonstrates timer interrupts using both a library config-
// uration, direct setup of a different timer, responding
// to Port J interrupts from on-board switches.
// Date: 19 Sep 2021
// Revision History : 20210919 - Initial implementation
@ajarmst
ajarmst / lcd.h
Created April 6, 2021 13:13
Sample header for Hitachi LCD Functions
/////////////////////////////////////////////////////////////////////////////
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: Simon Walker
// Details: LCD Library
// Revision History :
// Created : Unknown
// Dec 07 2020 - Modified Documentation
// Dec 2020 - Modified names, modified to use timer for delays
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// HC12 Program: Demo 02 - Timers
// Processor: MC9S12XDP512
// Bus Speed: 20 MHz (Requires Active PLL)
// Author: AJ Armstrong
// Details: Timer Demo
// Date: 1 Mar 2021
/////////////////////////////////////////////////////////////////////////////
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */