China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-21 05:53
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Interrupt of 8253 Timer under Turbo C 3.0 View 1,801 Replies 1
Original Poster Posted 2010-03-28 11:00 ·  中国 辽宁 大连 教育网
新手上路
Credits 8
Posts 3
Joined 2010-03-25 11:23
16-year member
UID 162994
Gender Male
Status Offline
Just started to get in touch with DOS. Since the requirement is that the I/O port of the industrial control computer sends a square wave of 1K - 10K, which cannot be realized under Windows, so I switched to DOS 7.1 (downloaded from the forum, thank you very much), and plan to use the timer of 8253 to do it.
I read a few examples, but I just don't know how to jump into this 8253 interrupt. The current test program is so long. Please help the master to answer and see what is missing.
#include "dos.h"
void interrupt intp()
{
enable();
}
void main()
{
disable();
outportb(0x43, 0x11); // Select 8253 counter 0, work in mode 0
outportb(0x40, 50); // Is to set the count initial value to 50
enable();
}
Floor 2 Posted 2010-03-28 11:25 ·  中国 辽宁 大连 教育网
新手上路
Credits 8
Posts 3
Joined 2010-03-25 11:23
16-year member
UID 162994
Gender Male
Status Offline
Or I'm looking for a source code for controlling the speaker using interrupts in Turbo C. Little brother is very grateful here
Forum Jump: