<?xml version="1.0"?>
<CHIP>
	<NAME>BULLDOG</NAME>
	<BLOCK>
		<NAME>SOC</NAME>
		<MODULE>
			<NAME>WDOG_TIMER</NAME> 	
			<DESC>
				This is the timer module for the Bulldog Chip. 
				<!-- Special SPS Tag which preserves white space -->
				\preserve\
				This timer module consists of:
				- A Fixed clock divider
				- A prescaler to create4 a programmable clock divider
				- 2 Programmable 8-bit timers, timer0 and timer1
				- A cascade mode to create a 16-bit timer out of timer0 and timer1,
				- A Watchdog timer.
				\preserve\
				The fixed clock divider is also used a baud rate generator for serial port control.	
				
			</DESC>
			<!-- This is an example of inserting an image in the html output -->
			<SEE_ALSO>IMG SRC = "smokey_wdog.jpg" </SEE_ALSO>
			<!-- This is an example of inserting a link to another web page in the html output-->
			<SEE_ALSO>"http://en.wikipedia.org/wiki/Watchdog_timer", More about Watchdog Timers</SEE_ALSO>
			<REGISTER>
				<NAME>CTRL</NAME>
				<SIZE>32</SIZE>
				<ADDRESS>0xFFFC0000</ADDRESS>
				<DESC>
					Timer Control. A 32-bit write on register to control the operation, clock 
					selection, and divide factor for timer 0 and timer 1.
				</DESC> 
							
				<FIELD>
					<NAME>DIVIDE_0</NAME>
					<BIT_FIELD>31:24</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>DIV0</MNE>
					<DESC>
						The divide factor between 1 and 256 for timer 0.
					 		
					</DESC>
					<!-- This is an example of linking to a preexisting SPS anchor-->
					<SEE_ALSO>"#0_DATA", See the WDOG_TIMER_0_DATA 8 bit Register</SEE_ALSO>
				</FIELD>
				<FIELD>
					<NAME>DIVIDE_1</NAME>
					<BIT_FIELD>23:16</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>DIV1</MNE>
					<DESC>
						The divide factor between 1 and 256 for timer 1.
					 		
					</DESC>
				</FIELD>
				
				<FIELD>
					<NAME>CLKSEL_0</NAME>
					<BIT_FIELD>15:12</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x0</POR>
					<MNE>CLK0</MNE>
					<DESC>
						A set of 15 fixed clock frequency rates. The following enumerations
						describe the settings.  This will be overwritten if the prescale bit
						is set for the corresponding timer.  
					</DESC>
					<!-- Example of enumerations which SPS will generate a enum header file -->
					<ENUM>
						<ESTRUCT>teTimerClkSel</ESTRUCT>
						<NAME>e0_3kHz</NAME>
						<VAL>0</VAL>
						<DESC>Nominal frequency = 0.3kHz</DESC>
						<NAME>e0_6kHz</NAME>
						<VAL>1</VAL>
						<DESC>Nominal frequency = 0.6kHz</DESC>						
						<NAME>e1_2kHz</NAME>
						<VAL>2</VAL>
						<DESC>Nominal frequency = 1.2kHz</DESC>						
						<NAME>e2_4kHz</NAME>
						<VAL>3</VAL>
						<DESC>Nominal frequency = 2.4kHz</DESC>						
						<NAME>e4_8kHz</NAME>
						<VAL>4</VAL>
						<DESC>Nominal frequency = 4.8kHz</DESC>						
						<NAME>e9_6kHz</NAME>
						<VAL>5</VAL>
						<DESC>Nominal frequency = 9.6kHz</DESC>						
						<NAME>e19_2kHz</NAME>
						<VAL>6</VAL>
						<DESC>Nominal frequency = 19.2kHz</DESC>						
						<NAME>e38_4kHz</NAME>
						<VAL>7</VAL>
						<DESC>Nominal frequency = 38.4kHz</DESC>
						
						<NAME>e57_6kHz</NAME>
						<VAL>8</VAL>
						<DESC>Nominal frequency = 57.6kHz</DESC>
						
						<NAME>e115_2kHz</NAME>
						<VAL>9</VAL>
						<DESC>Nominal frequency = 115_2kHz</DESC>
						
						<NAME>e230_4kHz</NAME>
						<VAL>10</VAL>
						<DESC>Nominal frequency = 230_4kHz</DESC>

						<NAME>e460_8kHz</NAME>
						<VAL>11</VAL>
						<DESC>Nominal frequency = 460_8kHz</DESC>
						
						<NAME>e921_6kHz</NAME>
						<VAL>12</VAL>
						<DESC>Nominal frequency = 921_6kHz</DESC>
						
						<NAME>e1843_2kHz</NAME>
						<VAL>13</VAL>
						<DESC>Nominal frequency = 1843_2kHz</DESC>
						
						<NAME>e6250_0kHz</NAME>
						<VAL>14</VAL>
						<DESC>Nominal frequency = 6250_0kHz</DESC>

						<NAME>eCascade0</NAME>
						<VAL>15</VAL>
						<DESC>Set Timer 1 only to this bit, sets up cascade mode</DESC>
					</ENUM>	
					<!-- This is an example of setting an anchor link-->	
					<SEE_ALSO>name="clk_sel0"</SEE_ALSO>
				</FIELD>
				<FIELD>
					<NAME>CLKSEL_1</NAME>
					<BIT_FIELD>11:8</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x0</POR>
					<MNE>CLK1</MNE>
					<DESC>
						A set of 16 fixed clock prescale rates.  To put the timers in
						cascade mode, set this bit to eCascade0.  The timer0 interrupt is
						used to signal athe end count of the cascaded counter.  The timer1
						interrupt is not used.
						
					</DESC>
					<!-- This is an example of linking to an anchor link on the same page 
					     In this case we are linking to the SPS auto-generated anchor
					     link for a field description-->
					<SEE_ALSO>"#CTRL_CLKSEL_0", See the CLKSEL_0 Field</SEE_ALSO>
				</FIELD>				
				<FIELD>
					<NAME>PRESCALE_0</NAME>
					<BIT_FIELD>7:6</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x0</POR>
					<MNE>PRES0</MNE>
					<DESC>
						Controls the prescaler for the timer 0.
						\preserve\
						0 = Normal
						1 = Prescale clock 16
						2 = Prescale clock 32
						\preserve\
						If this bit is set to 1 or 2, it will use the it's corresponding
						fixed clock select prescale value. It will override the clksel
						setting.
					</DESC>
				</FIELD>
				<FIELD>
					<NAME>PRESCALE_1</NAME>
					<BIT_FIELD>5:4</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x0</POR>
					<MNE>PRES1</MNE>
					<DESC>
						Controls the prescaler for the timer 1.
						\preserve\
						0 = Normal
						1 = Prescale clock 16 
						2 = Prescale clock 32
						\preserve\
						If this bit is set to 1 or 2, it will use the it's corresponding
						fixed clock select prescale value.  It will override the clksel
						setting.
					</DESC>
				</FIELD>				
				<FIELD>
					<NAME>INT_0</NAME>
					<BIT_FIELD>3</BIT_FIELD>
					<ACCESS_MODE>R/W1C</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>INT0</MNE>
					<DESC>
						The Interrupt status of Timer 0.
						\preserve\
						0 = No Interrupt.
						1 = Interrupt has occurred.
						\preserve\
						Setting this bit to 0 has not effect.  
						Setting it to 1 will clear the interrupt. 
					 		
					</DESC>
				</FIELD>
				<FIELD>
					<NAME>INT_1</NAME>
					<BIT_FIELD>2</BIT_FIELD>
					<ACCESS_MODE>R/W1C</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>INT1</MNE>
					<DESC>
						The Interrupt status of Timer 1.
						\preserve\
						0 = No Interrupt.
						1 = Interrupt has occurred.
						\preserve\
						Setting this bit to 0 has not effect.  
						Setting it to 1 will clear the interrupt. 
					 		
					</DESC>
				</FIELD>	
				<FIELD>
					<NAME>MODE_0</NAME>
					<BIT_FIELD>1</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>MODE0</MNE>
					<DESC>
						The timer 0 mode control. 
						When the timer is started the following is performed:
						\preserve\
						1. Count down to 1.
						2. Generate an interrupt and set the timer's interrupt bit
						3. Restarts from the programmed divide factor.
						\preserve\
						If the divide factor is changed while timer is running, it will not take
						effect until the ongoing count has expired.
						Valid Modes are 00,01,10, 11 = Reserved
					</DESC>
					<!-- Make an anchor link -->
					<SEE_ALSO>name="timer_mode0"</SEE_ALSO>
					<ENUM>
						<ESTRUCT>teTimermode</ESTRUCT>
						<NAME>eTimerStopAndLoad</NAME>
						<VAL>b00</VAL>
						<DESC>Stop the timer and load it witht the divide factor.</DESC>
						<NAME>eTimerStopAndPreserve</NAME>
						<VAL>b01</VAL>
						<DESC>Stop the timer and preserve the current count value. </DESC>
						<NAME>eTimerRun</NAME>
						<VAL>b10</VAL>
						<DESC>Start the timer as it is programmed. </DESC>
					</ENUM>	
				</FIELD>					
				<FIELD>
					<NAME>MODE_1</NAME>
					<BIT_FIELD>0</BIT_FIELD>
					<ACCESS_MODE>R/W</ACCESS_MODE>
					<POR>0x00</POR>
					<MNE>MODE1</MNE>
					<DESC>
						The timer 1 mode control. 
					</DESC>
					<SEE_ALSO>"#timer_mode0", See Timer Mode 0 Description</SEE_ALSO> 
				</FIELD>			
			</REGISTER>
		</MODULE>
	</BLOCK>
</CHIP>	

