simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Simulavr-devel] interrupt flag/enable bits update


From: Theodore A. Roth
Subject: [Simulavr-devel] interrupt flag/enable bits update
Date: Fri, 28 Nov 2003 12:58:35 -0800 (PST)

I've updated John's patch for adding interrupt flag/enable bits to the 
vector tables. I added the bit defs for the 1200, 2313 and 4414 vector 
tables. Also added stubs for the usb device vector tables which still need 
to be defined properly (I don't have the datasheets handy for those yet, 
will get them later this weekend). The patch compiles now. I'm inclined to 
just commit it and then update the usb devices as an additional patch (which 
has to be in place before John's changes to vectoring are committed).

John:
I made a few cosmetic changes to your patch.

Most notably changing NO_BIT to 0's instead of -1. I think this is preferred
since the table entries that are not explicitly initialized are implicitly
initialized to 0 anyways.

I also noticed the the USART1 flags where at the wrong address (0x9a instead 
of 0x9b). I'm assuming that was just a copy/paste error.

One last question. I noticed that the .SPI_STC flag is always set to NO_BIT 
even though there is a SPIF flag bit. From the datasheet for the mega128:

  * Bit 7 SPIF: SPI Interrupt Flag

     When a serial transfer is complete, the SPIF flag is set. An interrupt
     is generated if SPIE in SPCR is set and global interrupts are enabled. 
     If SS is an input and is driven low when the SPI is in Master mode, 
     this will also set the SPIF flag. SPIF is cleared by hardware when 
     executing the corresponding interrupt handling vector. Alternatively, 
     the SPIF bit is cleared by first reading the SPI Status Register with 
     SPIF set, then accessing the SPI Data Register (SPDR).

This seems a little problematic. I think you are right not to define the 
flag by default. To handle this properly, it looks like the SPI VDev is 
going to have to modify the vector table when the SS condition requires it. 
Want do you think?

Keith:
If you get a chance be I get to it, can you help out with adding the 
enable/flag bits for the usb devices? What do you think about the SPIF bit?

Ted Roth

Attachment: sim-irq-ctrl-bit.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]