piclist 2001\01\10\140443a >
Thread: Problems using a 1x8 chars LCD
www.piclist.com/techref/io/lcd/pic.htm?key=lcd
flavicon
face BY : David VanHorn email (remove spam text)



At 07:48 PM 1/10/01 +0100, Andreas Eriksson wrote:
> >
> >Dosen't this require NOPs between the instructions, to get around the
> >read-modify-write "feature"?
> >
>
>read-modify-write feature?


A peculiarity of Pics, where subsequent BCF/BSF operations in any order,
may cause undesired results, due to the way that the pic outputs data to
the port.

Ex:

Start with two bits at zero
bsf     PORTB,0
bsf     PORTB,1

You would expect PORTB to now be XXXXXX11, but it may be XXXXXX10
What happens is that the BSF instruction reads port B into a temp register,
sets the bit, then writes it back out to the port.
If bit 0 on the processor pin hasn't had time to come high, then the next
BSF (Or BCF) will read it as a zero, and write it back out as a zero.
The key point is that there's only 1/4 clock between the time that the
first output happens, and the second instruction is reading.

It's in the pic manuals.


>Arent you supposed to just set RS=0(instruction, not data) RW=0(write)
>E=1>0(pulse)?


From my AND data book, the sequence is

/RS,/RW,/E <delay 140ns>
/RS,/RW,E <delay 450ns>
/RS,/RW,/E <delay 10ns>
At this point, RS, RW, and data are free to change.
The delays are only an issue with very fast pics (or slow AVRs)


--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamspammitvma.mit.edu with SET PICList DIGEST in the body


<4.3.2.7.2.20010110135400.00c211c0@mail.cedar.net>

In reply to: <002701c07b35$e4f7c4a0$0239a8c0@vulva.swip.net>
See also: www.piclist.com/techref/io/lcd/pic.htm?key=lcd
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Problems using a 1x8 chars LCD

month overview.

new search...