Thread View: net.micro.atari
1 messages
1 total messages
Started by Jwahar R. Bammi
Tue, 07 Jan 1986 07:36
ST help!
Author: Jwahar R. Bammi
Date: Tue, 07 Jan 1986 07:36
Date: Tue, 07 Jan 1986 07:36
73 lines
2030 bytes
2030 bytes
Has anyone had any luck with the xbios Xbtimer() trap. Every time I
try to use it I get 2 Mushrooms. I have tried my code in supervisor
mode and get the same result. Here is a short test program I wrote
to see what was going on. I use a control register value of 7 which
should give me a prescale value of 200, and data register value of 0
that should give me a count of 256 for timer 'a' on the 68901.
Theoretically i should get an interrupt frequency of 48 Hz.
( 2.4576 Mhz / 256 / 200 ).
#include <osbind.h>
#define VOID int
long counter;
/* Interrupt handler */
VOID my_handler()
{
counter++;
}
/* Start_timer */
VOID start_timer()
{
VOID my_handler();
/* Start the timer */
counter = 0L;
Xbtimer(0, 7, 0, my_handler);
}
/* Stop the timer */
VOID stop_timer()
{
VOID my_handler();
/* Stop the timer by clearing the timer a control register */
Xbtimer(0, 0, 0, my_handler);
}
/* Stack pointer save area */
long ssp_save;
main()
{
/* Save the super stack, get into super mode using USR stack */
ssp_save = Super(0L);
start_timer();
while(counter == 0L)
/* twiddle thumb */;
/* Got interrupt */
stop_timer();
/* get out of supervisor mode */
Super(ssp_save);
Cconws("I made it!!\r\n");
/* I never get the message */
}
Any help will be much appreciated.
--
Jwahar R. Bammi
Usenet: .....!decvax!cwruecmp!bammi
CSnet: bammi@case
Arpa: bammi%case@csnet-relay
CompuServe: 71515,155
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads