Example Code for DOS
serial comunications
serial.zip (5 KB)
This interrupt driven serial communications program works with COM1 or COM2 as a dumb terminal emulator. All serial data received will be sent to the console, all console input will be sent out the serial port. This program will work with VGA/keyboard or with the console redirected to the other COM port.
matrix keypad
keypad.zip (9 KB)
The matrix keypad code uses 8 digital I/O lines as row outputs and column inputs to scan a 4x4 keypad. The square wave output function of the real time clock is used as a pacing clock to generate interrupts on IRQ8. The interrupt service routine calls the keypad scan routine and provides debounce timing.
This code is a good example of using the real time clock and IRQ8 to provide interrupt driven timing.
(There is also a BIOS function which uses the matrix keypad as stdin. This code is not part of the BIOS function, but rather provides the same functionality without stuffing the scancodes into the standard PC keyboard buffer.)
external interrupt inputs
irqs.zip (14 KB)
These routines demonstrate setting up interrupt service routines which are triggered by externally available IRQ pins. The IRQ pins are available as digital I/O and in most cases the processor specific pin configuration registers must be changed to enable the IRQ function of the pin. If the product/IRQ combination you need isn't already done, let us know and we can add the one you need. support@embeddedARM.com
timer 1 and IRQ10
t1_irq10.zip (6 KB)
This routine uses the timer 1 square wave function to generate interrupts on IRQ10. The 1 MHz system clock is driving the clock input on timer 1. The divider is set to 250 in this example to provide a 4 KHz interrupt rate. (386EX products only)
misc. utils
misc.zip (41 KB)
This is a collection of routines written in C for Turbo C++ 3.0, DOS executables and source code included.
- I/O read/write code (in.c, out.c)
- I/O pin toggle code (toggle.c)
- Real Time Clock read/write code (rtc_in.c, rtc_out.c)
- Jumper block detection for TS-5x00 (jumper.c)
- Reset.com - performs hardware reset using watchdog timer (386EX only, reset.asm & reset.cpp).
|