To write a byte, you just address the register as an 8-bit address. For example, EP0 FIFO data register (address MBAR + 0xB450) could be accessed as follows in C (assuming __MBAR is defined as a byte array that points to the start of the internal module memory map):
uint8 data8 = 0xAB;
uint16 data16 = 0xABCD;
uint32 data32 = 0xABCD0123;
*(uint8*)(&__MBAR[0x00B450]) = data8;
*(uint16*)(&__MBAR[0x00B450]) = data16;
*(uint32*)(&__MBAR[0x00B450]) = data32;
Internally, the byte accesses will use the upper byte lane (31:24) to transfer the data for byte accesses, but you don't really need to worry about that. Just access it at the base address no matter what the transfer size is.
Note that the C header files provide macros for the different accesses, so the above could be:
MCF_USB_EP0FDR_8 = data8;
MCF_USB_EP0FDR_16 = data16;
MCF_USB_EP0FDR_32 = data32;
Message Edited by mnorman on 04-19-2006 01:45 PM