I believe you've found a bug...
The #define from mcf5222x_reg.h:
Code:
#define MCF_USB_FRM_NUM (MCF_USB_INT_STAT=MCF_USB_INT_STAT_SOF_TOK ,MCF_USB_FRM_NUML | (((hcc_u16)MCF_USB_FRM_NUMH)<<8))
Is not atomic -- it can read the low and high bytes in either order, and one can be before a rollover and the other can be after.
To protect this, I believe you'd need to assemble the 16 bit result and "validate" it -- if it looks invalid (i.e., if the low and high bytes don't appear to have consistently rolled over), you'd have to retry the assembly -- if new low is less than old low (i.e., rollover occurred) and new high is not greater than old high (rollover did not occur consistently), then retry the assembly.
Or for your purposes (depending on the interval required), you might be able to get by just using the low 8 bits of the frame number.
-- Rich