It's often useful to have a flashing LED in embedded systems to verify the system is 'running' and healthy. I coded up a 500ms heartbeat using the Motorolla 68HCS12 in C. See below.
#include "vectors12.h"
#include "ioregs12.h"
#include "bits.h" // custom header containing bit values in hex
#define INTERRUPT void __attribute__ ((interrupt))
#define sei() __asm__ __volatile__ ( "sei" )
#define cli() __asm__ __volatile__ ( "cli" )
#define wai() __asm__ __volatile__ ( "wai" )
volatile unsigned int hbcount;
INTERRUPT rti_interrupt(void);
int main(void)
{
// Initialization
sei(); // diable interrupts
UserRTI = (unsigned int) &rti_interrupt;
RTICTL = 0x40; // set RTICTL for 1ms interrupt
CRGINT = BIT8; // enable RTI interrupts
DDRT |= BIT8; // or equal
cli(); // clear interrupt flag
while (1)
{ // idle loop
wai();
};
return 0;
}
INTERRUPT rti_interrupt(void)
{
CRGFLG = 0x80; // acknoledge RTI & clear interrupt flag
hbcount++;
if (hbcount >= 489) // Reset hbcount every 500ms
{
hbcount = 0;
PTT = PTIT ^ BIT8; // exclusive or PTT
}
}
Monday, April 13, 2009
Tuesday, January 13, 2009
PDP-8 Minicomputer
Friday, January 2, 2009
Parallel Adder / Multiplier using VHDL

Sunday, December 14, 2008
Current Project: Temperature Controlled Voltage Source
Saturday, October 18, 2008
Modeling Temperature Behavior in LTSpice

Modeling temperature behavior in LTSpice.
I'm working on a temperature controlled amplifier using a thermocouple and operational amplifier. The simple circuit is shown above. The operational amplifier simply amplifies the thermocouple input voltage. The thermocouple input voltage is obviously a function of the temperature (measured between the reference junction and the measuring junction). For modeling purposes, the thermocouple is modeled as a voltage supply.
To simulate the changes in voltage as a function of temperature, setup a sweep in LTSpice using the .step command as shown. Next, establish a parameter using the .PARAM command, creating a new variable as a function of the sweep. This variable can then be used in the circuit. In this example, the "thermocouple" supply voltage changes based on the 'THERM' variable. The voltage graph shows output voltage as a function of temperature.

Saturday, October 4, 2008
Active Filters

Filters are used in a wide variety of electronic
applications. Band-pass filters are used in the field of
telecommunications for speech processing. High-frequency
band-pass filters are used for channel selection in many telephone
applications. Digital signal processing systems use low-pass
anti-aliasing filters as well as low-pass noise filters in conditioning
stages. Power supplies use band-rejection filters to suppress line
frequency signals and high frequency components. Additionally,
filters can be specifically designed to provide phase shifts to each
frequency component while not filtering any frequencies. Active
filter schemes use operational amplifiers, or other active
components, in conjunction with resistors and capacitors to
provide filtering without the need for large inductors as required
in passive filtering. This paper compares the difference between
passive and active filters, and presents all the schemes highlighted
(i.e. low-pass, high-pass, band-pass, band-stop). Popular active
filtering techniques are presented including the Butterworth
filter, Chebyshev filter, and the Bessel filter. The low-pass
Butterworth filter is analyzed in detail, simulation and
experimental results are presented. See "Active Filters" under "papers" on the right for the full document.
Direct Sequence Spread Spectrum
Subscribe to:
Posts (Atom)