Hi, I’m a little bit in doubt about following function:
FUNCTION MIOS_DOUT_SRSet
DESCRIPTION sets value of DOUT shift register
IN number of shift register in WREG
value in MIOS_PARAMETER1
OUT pointer to shift register in FSR1
USES FSR1 and BSR
Is this function to set the active SR (followed by an instruction to set one pin H or L; bit operation) or can it be used to send a byte (value MIOS_PARAMETER1) to a specific SR (number in WREG)?
My experiments give me confusing results, but I managed to get (mostly intended) stuff on my display.
There is no active SR, MIOS loads the whole SR chain (16 DIN shift registers and 16 DOUT shift register) on every update cycle. You can use the MIOS_DOUT_SRSet function whenever you want (within or outside an interrrupt service routine) to set the 8-bit value of a single shift register directly. You can also use this function to get a pointer to this register to access it several times without loosing instruction cycles due to the “call” overhead.
The functions for setting a single pin are called MIOS_DOUT_PinSet0 and MIOS_DOUT_PinSet1
why different functions? Because MIOS_DOUT_SRSet works much faster (since you are able to set 8 pins at once and you are able to work with the return pointer), but MIOS_DOUT_PinSet[01] looks more understandable for beginners who are reading the source code.