Searching \ for 'Problem with RLF ?' 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/index.htm?key=problem+with+rlf
Search entire site for: 'Problem with RLF ?'.

Truncated match.
PICList Thread
'Problem with RLF ?'
1997\04\09@200451 by Steve Hardy

flavicon
face
> From: Philip Martin <spam_OUTphilipTakeThisOuTspamPHILMART.DEMON.CO.UK>
> [cut]
> Is my logic of the RLF command  correct ?
>
> I've tried the line [   movlw   .4], on rotation this gave the hex
> numbers 4 - 9 - 12. With [      movlw   b'00000100'], this gave the
> sequence 4 - 0C - 18.
>
> It's obvious that an extra '1' is creeping in each time but why ?
>
> Also, the command rlf   portb,f seems to work but I'm not totally sure
> why. Is it that the 'f' tells it to send the result to the port ?

Yes.

>

Now Philip, you must really get around to reading the manual.  You
will find that RLF uses the STATUS,C (carry) bit to set the value of
the LSB.  Similarly, RRF uses the carry bit to set the MSB.  The
bit 'on the other end' which is shifted out is used to set the
carry bit for the next operation.  If you want to guarantee that
there are no extraneous '1's shifted in, do a 'BCF STATUS,C' before
shifting.

Regards,
SJH
Canberra, Australia

1997\04\10@051641 by Philip Martin

flavicon
picon face
In article <.....9704100003.AA02686KILLspamspam@spam@keeper.stortek.com>, Steve Hardy
<hardyspamKILLspamSWENG.STORTEK.COM> writes
{Quote hidden}

Steve,

Thanks for your reply and yes I have read the manual :-), that is the
Microchip spec sheet for the 16C84 and a guide to the microchip. Ahhh if
only we understood everything we read at the first reading :-).

Thing is, I was aware that using the rotate command would shift a carry
bit out and set a status flag. what I cant understand is why extra bits
are creeping in, sometimes next to the shifted bit. If they were always
coming in at the LSB position this might make some sense. I thought it
might have something to do with the way I was using the port? Having run
the code in MPLAB-SIM the 06h register is certainly at 00 before the
routine acts upon it, but I certainly take your point that clearing the
STATUS,C bit would prevent any odd bit that may be sitting there from
being shifted into the LSB on the port.


Regards,

--
Philip Martin   ----------------------------------------------------------------
Royal Quays             If at first you don't succeed, try again. Then quit:
North Shields.          no use being a damn fool about it !
                                                       W.C. Fields
email EraseMEphilipspam_OUTspamTakeThisOuTphilmart.demon.co.uk

1997\04\10@061221 by Kieran Sullivan

flavicon
face
Thing is, I was aware that using the rotate command would shift a carry
bit out and set a status flag. what I cant understand is why extra bits
are creeping in, sometimes next to the shifted bit. If they were always
coming in at the LSB position this might make some sense. I thought it
might have something to do with the way I was using the port? Having run
the code in MPLAB-SIM the 06h register is certainly at 00 before the
routine acts upon it, but I certainly take your point that clearing the
STATUS,C bit would prevent any odd bit that may be sitting there from
being shifted into the LSB on the port.

I think seeing as the rlf will be reading from the port, you might get problems. You might be better keeping the value you want on the port in a file register and rotating the file register, then wring the file register to the port. On the other hand, if you really want to read the value on the port before rotating it, read the value to the file register, rotate the file register then write the file register to the port again.

Kieran Sullivan


Regards,

--
Philip Martin   ----------------------------------------------------------------
Royal Quays             If at first you don't succeed, try again. Then quit:
North Shields.          no use being a damn fool about it !
                                                       W.C. Fields
email philipspamspam_OUTphilmart.demon.co.uk

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