Searching \ for 'Analizing AN555..+ serial timeout' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/serials.htm?key=serial
Search entire site for: 'Analizing AN555..+ serial timeout'.

Truncated match.
PICList Thread
'Analizing AN555..+ serial timeout'
1996\05\23@021022 by Edwin Baaij

flavicon
face
Hello,

Before modifying AN555, I'm trying to understand the source code. Much of it
I do understand but I'm puzzled by the following:

In the code for GetChar, _SbitDetected and RcvNectBit, I frequently find code
like;

 clrf  _rtcc
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option    ; assign Prescaler to TRM0

 bcf _rp0
 clrf  _rtcc
 bsf _rp0
 movlw 0Fh
 movwf _option    ; assign Prescaler to WDT

 clrwdt
 movlw _OPTION_SBIT
 movwf _option    ; assign Prescaler to TMR0?
 bcf _rp0
 movlw 0xFF
 movwf _rtcc      ; load rtcc with 0xFF


To me it looks like they're assigning the Prescaler back and fore between
TRM0 and WDT. And I can figure out why!
In the code for _RcvNextBit is't done 4 times!!!:

_RcvNextBit:
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option     ;WDT -> TMR0?

 bcf _rp0
 clrf  _rtcc
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option     ;WDT -> TMR0?

 bcf _rp0
 clrf  _rtcc
 bsf _rp0
 movlw 0Fh
 movwf _option     ; TMR0 -> WDT?

 clrwdt
 movlw (_OPTION_INIT | RtccPrescale) ;
 movwf _option       ; Final assignment?
;

Does anybody know what's done with this code? My purpose is to modify the
code in a way that i'm able to generate a timeout when it takes to long
before the next byte is received. A start bit now generated a rtcc
rollover-interrupt. My idea is to let this be done by the external interrupt
or the port-B change interrupt. It looks to me that than I have the timer
free to count for a timeout.

Is there somebody who has alredy made this kind of modification, and if yes,
willing to share the source??

Edwin
Edwin Baaij  (Electronic Engineer)
*********************************************************************
University of Amsterdam                 phone:  +31-20-5256346
Van der Waals,- ZeemanInstitute         fax:    +31-20-5255877
Valckenierstraat 65-67                  e-mail: spam_OUTbaaijTakeThisOuTspamphys.uva.nl
1018 XE Amsterdam
*********************************************************************

1996\05\29@020635 by Edwin Baaij

flavicon
face
Hello,

Before modifying AN555, I'm trying to understand the source code. Much of it
I do understand but I'm puzzled by the following:

In the code for GetChar, _SbitDetected and RcvNectBit, I frequently find code
like;

 clrf  _rtcc
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option    ; assign Prescaler to TRM0

 bcf _rp0
 clrf  _rtcc
 bsf _rp0
 movlw 0Fh
 movwf _option    ; assign Prescaler to WDT

 clrwdt
 movlw _OPTION_SBIT
 movwf _option    ; assign Prescaler to TMR0?
 bcf _rp0
 movlw 0xFF
 movwf _rtcc      ; load rtcc with 0xFF


To me it looks like they're assigning the Prescaler back and fore between
TRM0 and WDT. And I can't figure out why!
In the code for _RcvNextBit is't done 4 times!!!:

_RcvNextBit:
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option     ;WDT -> TMR0?

 bcf _rp0
 clrf  _rtcc
 clrwdt
 bsf _rp0
 movlw 07h
 movwf _option     ;WDT -> TMR0?

 bcf _rp0
 clrf  _rtcc
 bsf _rp0
 movlw 0Fh
 movwf _option     ; TMR0 -> WDT?

 clrwdt
 movlw (_OPTION_INIT | RtccPrescale) ;
 movwf _option       ; Final assignment?
;

Does anybody know what's done with this code? My purpose is to modify the
code in a way that i'm able to generate a timeout when it takes to long
before the next byte is received. A start bit now generated a rtcc
rollover-interrupt. My idea is to let this be done by the external interrupt
or the port-B change interrupt. It looks to me that than I have the timer
free to count for a timeout.

Is there somebody who has alredy made this kind of modification, and if yes,
willing to share the source??

Edwin
Edwin Baaij  (Electronic Engineer)
*********************************************************************
University of Amsterdam                 phone:  +31-20-5256346
Van der Waals,- ZeemanInstitute         fax:    +31-20-5255877
Valckenierstraat 65-67                  e-mail: .....baaijKILLspamspam@spam@phys.uva.nl
1018 XE Amsterdam
*********************************************************************

1996\05\29@024446 by fastfwd

face
flavicon
face
Edwin Baaij <PICLISTspamKILLspamMITVMA.MIT.EDU> wrote:

> Before modifying AN555, I'm trying to understand the source code.
> Much of it I do understand but I'm puzzled by the following:
> ....
> To me it looks like they're assigning the Prescaler back and fore
> between TRM0 and WDT. And I can't figure out why! In the code for
> _RcvNextBit is't done 4 times!!!:
> ....
> Does anybody know what's done with this code?

Edwin:

I haven't looked at that code, but my guess is that they're switching
the TMR0 prescaler between divide-by-1 and divide-by-something-else;
the only way to achieve a TMR0 prescaler of divide-by-1 is to assign
the prescaler to the WDT.

Does this seem reasonable?

-Andy

Andrew Warren - .....fastfwdKILLspamspam.....ix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...