Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcdchg!motmpl!ron From: ron@motmpl.UUCP (Ron Widell) Newsgroups: comp.sys.m68k Subject: Re: How to cause an SCC2 interrupt on the MC68302 Message-ID: <1856@motmpl.UUCP> Date: 2 Nov 90 23:33:54 GMT References: <157@jim.UUCP> Reply-To: ron@motmpl.UUCP (Ron Widell) Distribution: na Organization: Motorola Semiconductor, Minneapolis, MN. Lines: 35 Joe Hughes (jwh@wgate.UUCP) writes: > > I need some expert help on how to code the mc68302 so that it causes an >SCC2 interrupt. I am developing software for use on a custom board that uses >the mc68302. One of my tasks is to do asynchronous i/o via the SCC2. After ... >I would appreciate the help. The SCC2 is set to normal operation, non-multi, >uart, with an internal 9660 baud rate. Thanks for the help in advance. I assume you meant 9600 ^^^^ :-) What is the value of MAX_IDL (SCC Base + 0x9c)? As described in number 6 on pg. 4-50 of the MC68302 User's Manual (Rev 1), this is the maximum amount of time (effectively measured in character times) that the SCC will wait between characters without generating an interrupt to the core 68000. It does an add for each idle sequence (9-13 consecutive ones, effectively one character time) and then compares this to the value in MAX_IDL to see if it should interrupt. One of the more common problems is that people don't initialize this location, or initialize it to 0 (which means the the value will have to roll over from 0xffff before the timeout ocurrs) let's see: assuming 1 start, 8 data, 1 stop= 10 bit characters, we will not get an interrupt until 1) the Rx buffer length is reached (MRBLR) 2) an error (BREAK, overrun, framing, noise, etc.) occurs, or 3) a timeout occurs (9600 baud approx = 960 chars. / sec, so 65536 char. times / 960 chars. per sec = 68.26 seconds). Note that the count-up value gets reset for each valid character received, so you will wait (assuming the Rx buffer is not full and no error occurs) 68.26 seconds after the last character is received before you get the interrupt. This is probably *NOT* what you wanted :-). Hope this helps. -- Ron Widell, Field Applications Eng. |UUCP: {...}mcdchg!motmpl!ron Motorola Semiconductor Products, Inc., |Voice:(612)941-6800 9600 W. 76th St., Suite G | I'm from Silicon Tundra, Eden Prairie, Mn. 55344 -3718 | what could I know?