Per Manual 2 Page 76
HSERSETUP
=======================================================
In automatic mode the hardware serial input is fully automated. Serial data
received by the hardware pin is saved into the scratchpad memory area as
soon as it is received.
Upon the hsersetup command the serial pointer (hserptr) is reset to 0.
When a byte is received it is saved to this scratchpad address, the hserptr
variable is incremented and the hserinflag flag is set (must be cleared by user
software).
Therefore the value `hserptr -1' indicates the last byte written, and
`hserinflag = 1' indicates a byte has been received (see also the setintflags
command). The scratchpad is a circular buffer that overflows without
warning.
=========================================================
If I take this at face value there is a system variable called "hserptr"
and I should be able to read it like any other variable ? Correct ?
Then it says that "the hserinflag flag ..... must be reset by user software".
But no further explanation is given as to how ... or when this is necessary.
Shall I assume that "user sofware" means the running program and that the
Hser interrupt needs to be cleared at some point via the setintflags command?
Let me see if I understand this correctly.
So the Hserint Flag is set to 0 when HSERSETUP is invoked. The program
goes happily about its business until the first data byte is received. This
triggers an interrupt and set the hserint Flag to 1. Program execution then
stops while data is received. Program execution does not resume until the
program clears the interrupt via setintflags command. ?????
I have HSERIN and HSEROUT working fine at 9600 - 38400 baud. However
since the simulator cannot simulate background receive I cannot really test
anything without some kind of starting point for code. I am baffled.
The Manual 2 is vague and offers ABSOLUTELY NOTHING in the way of a
practical example on how to use HSERSETUP in background receive mode.
Can a practical example be provided ? Please, something a bit more than 2
lines with no explanation.
Thanks,
Goey
HSERSETUP
=======================================================
In automatic mode the hardware serial input is fully automated. Serial data
received by the hardware pin is saved into the scratchpad memory area as
soon as it is received.
Upon the hsersetup command the serial pointer (hserptr) is reset to 0.
When a byte is received it is saved to this scratchpad address, the hserptr
variable is incremented and the hserinflag flag is set (must be cleared by user
software).
Therefore the value `hserptr -1' indicates the last byte written, and
`hserinflag = 1' indicates a byte has been received (see also the setintflags
command). The scratchpad is a circular buffer that overflows without
warning.
=========================================================
If I take this at face value there is a system variable called "hserptr"
and I should be able to read it like any other variable ? Correct ?
Then it says that "the hserinflag flag ..... must be reset by user software".
But no further explanation is given as to how ... or when this is necessary.
Shall I assume that "user sofware" means the running program and that the
Hser interrupt needs to be cleared at some point via the setintflags command?
Let me see if I understand this correctly.
So the Hserint Flag is set to 0 when HSERSETUP is invoked. The program
goes happily about its business until the first data byte is received. This
triggers an interrupt and set the hserint Flag to 1. Program execution then
stops while data is received. Program execution does not resume until the
program clears the interrupt via setintflags command. ?????
I have HSERIN and HSEROUT working fine at 9600 - 38400 baud. However
since the simulator cannot simulate background receive I cannot really test
anything without some kind of starting point for code. I am baffled.
The Manual 2 is vague and offers ABSOLUTELY NOTHING in the way of a
practical example on how to use HSERSETUP in background receive mode.
Can a practical example be provided ? Please, something a bit more than 2
lines with no explanation.
Thanks,
Goey