[mC for PIC]GLCD_read_data() problem

Discuss about beta versions of mikroC compiler.
Post Reply
Author
Message
bruno
Posts: 767
Joined: 10 Sep 2005 02:10
Location: Lyon, France
Contact:

[mC for PIC]GLCD_read_data() problem

#1 Post by bruno » 13 Oct 2008 01:25

Hi,

this code does not give expected result :

Code: Select all

                        GLCD_set_side(x) ;
                        GLCD_set_x(x % 64) ;
                        GLCD_set_page(y) ;
                        *map++ = GLCD_read_data() ;
first map byte gets unpredictable result and content is shifted by one

to fix, read GLCD once for nothing :

Code: Select all

                        GLCD_set_side(x) ;
                        GLCD_set_x(x % 64) ;
                        GLCD_set_page(y) ;
                        GLCD_read_data() ;  // now it works
                        *map++ = GLCD_read_data() ;
(using PIC18F4620)
Bruno
Bored with 7-segment ? Try the [url=http://www.micro-examples.com/public/microex-navig/doc/079-touchclock.html]TouchClock[/url]

Post Reply

Return to “mikroC Beta testing”