Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site kitty.UUCP
Path: utzoo!watmath!sunybcs!kitty!larry
From: larry@kitty.UUCP (Larry Lippman)
Newsgroups: net.micro
Subject: Re: Use of timers on INTEL 80186
Message-ID: <304@kitty.UUCP>
Date: Sat, 10-Aug-85 19:06:00 EDT
Article-I.D.: kitty.304
Posted: Sat Aug 10 19:06:00 1985
Date-Received: Sun, 11-Aug-85 08:27:24 EDT
References: <542@brl-tgr.ARPA> <3437@utah-cs.UUCP>
Organization: Recognition Research Corp., Clarence, NY
Lines: 34

> 	We are building a small system here based on an INTEL 80186
> and are trying to use one of the on chip timers to generate a baud
> rate clock.  The '186 is running at 8 MHz (16 MHz crystal) and we
> are trying to use TIMER 0 on the chip as the generator for a x16
> clock for a 9600 baud serial line.
> 	Our processor registers (TIMER, DMA, memory control etc.)
> are mapped to memory starting at F0000H.  Our code does the
> following:
> 		Set location F0052H (Timer 0 A register) to 0DH
> 		Set location F0056H (Timer 0 cntl)       to C001H
> 	The above is pretty much a copy of what is done in the INTEL
> application note AP 186.  It does work ONCE. It will continue to run
> for hours this way but after the chip is warmed up if it is RESET or
> powered down and back up again this timer won't work again.  ...

	Simple problem, simple solution - I believe...  
	Timer 0 and timer 1 both have INPUT pins (20 and 21, respectively)
which ALWAYS do something.  If you have EXT bit as 1, then these pins supply
the external clock; if EXT is 0 and you are using the internal clock (as you
are), then these pins function as a gate or reset depending upon the value of
RTG bit.  Since you have RTG as 0, and based upon your application, you must
have pin 20 logically HIGH.  I betcha it's floating in the breeze...
	One other piece of advice I have learned the hard way: Don't take
the Intel APP notes as gospel!

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|	Larry Lippman @ Recognition Research Corp., Clarence, New York        |
|	UUCP	{decvax,dual,rocksanne,rocksvax,watmath}!sunybcs!kitty!larry  |
|					    {rice,shell}!baylor!/	      |
|	VOICE	716/741-9185			      syr!buf!/		      |
|	TELEX	{via WUI} 69-71461 ansbak: ELGECOMCLR			      |
|									      |
|	"Have you hugged your cat today?"				      |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++