PDA

View Full Version : DEFINE HSER_CLROERR 1 ; how do I work? am I taxing performance heavily?



rayzrocket
- 9th December 2013, 07:29
How does DEFINE HSER_CLROERR 1 work?
Does it turn on interrupts and toggle CREN & SPEN when the recieve buffer interrupt is thrown?
or simply toggle CREN & SPEN bits whenever anything hits the receive buffer(OERR bit? or RCIF transfer bit?) ?
...
also, is there anyway for me to see what 'DEFINES' are coded to do?

thanks in advance! :)

rayzrocket
- 9th December 2013, 07:40
Ahh, I figured out that the .lib files in pic basic pro folders contain the secrets of DEFINES!!!
This DEFINE does this..
HSERIN
ifdef HSER_CLROERR
btfsc RCSTA, OERR ; Check for overflow error
bcf RCSTA, CREN ; Toggle continuous receive to clear error
bsf RCSTA, CREN
endif
for every HSERIN used in code...(I had a manual implementation of this..but your DEFINE seems to work just fine also)

also....there is this that the DEFINE is doing:
ifdef HSER_CLROERR
btfsc RCSTA, OERR ; Check for overflow error
bcf RCSTA, CREN ; Toggle continuous receive to clear error
bsf RCSTA, CREN
endif
..
thanks ray,
you r welcome ray!
It's ok to talk to myself as long as I don't talk back! (Quote from Fred Sanford, 'Sanford and Son' show)