LTSpice is a great free circuit simulator. The software and introduction videos can be found at: www.cmosedu.com
Saturday, August 29, 2009
Getting Started with LTSpice
LTSpice is a great free circuit simulator. The software and introduction videos can be found at: www.cmosedu.com
Sunday, June 14, 2009
New Mac Mini
I finally took the plunge and picked up a Mac. I'm recording a brief diary of pros/cons from my journey:
Monday, April 13, 2009
68HCS12 Heartbeat
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
}
}
#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
}
}
Tuesday, January 13, 2009
PDP-8 Minicomputer
Friday, January 2, 2009
Parallel Adder / Multiplier using VHDL
I designed a state machine controller using VHDL. This state machine implemented a parallel adder and multiplier with overflow capability. This project used the Nexys2 board from Digilent. I used Xilinx ISE for the coding and Modelsim for the simulation. For a full report see "Adder / Multiplier in VHDL" under papers.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.
Subscribe to:
Posts (Atom)

