Hi Rob Thank you very much. I tested this program on bread broad and when I change my board in pcb board , everything is ok.
I don't know what my wrong was?! But now, everything is good. Thank you Rob. Kind regards. On Friday, July 23, 2021 at 12:20:57 AM UTC+4:30 [email protected] wrote: > Hi Majid, > > I did a test with the Nokia 5110 display which has a resolution of 84 x 48 > pixels. > > Since you can only write to this Nokia display the JAL driver for this > display keeps a pixel cache which is first updated with the pixel data and > then written to the display so it is different from yours. In your case the > driver reads data from the display, updates that and writes it back. > > With the following code I was able to write a box at the edges of the > display (the delays are just to see it working) for the Nokia display: > > glcd_clear_cache() > nokia_clear_screen() > delay_1s(1) > glcd_box(0,0,83,47) > glcd_cache_update() > delay_1s(3) > > In the libraries the glcd_box function calls glcd_line function which in > the end calls the glcd_write_pixel function. The first two functions are in > glcd_common.jal but the glcd_write_pixel_function is device specific and is > so part of the Nokia library and part of the KS0108 library. > > So if something is wrong then I assume it must be in the pixel function. > So what you could do is test if you can write pixels in all corners of the > display. > > I used this code for the Nokia display and I see a pixel in each corner so > that works correctly. > > glcd_clear_cache() > nokia_clear_screen() > delay_1s(1) > glcd_write_pixel(0,0) > glcd_write_pixel(83,0) > glcd_write_pixel(0,47) > glcd_write_pixel(83,47) > glcd_cache_update() > delay_1s(3) > > Can you test if you can write these pixels too using the resolution of > your display? > > The total program is attached in the zipfile. > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens Rob CJ < > [email protected]> > *Verzonden:* donderdag 22 juli 2021 19:17 > > *Aan:* jallib <[email protected]> > *Onderwerp:* Re: [jallib] when i use KS0108 , the micro reseted ?? > Hi Majid, > > I do not have your display but I can test it on a Nokia display. It does > not use your driver but is uses a part of the glcd_common. Maybe there is > an issue there. > > In the following video you can see what I tested bu I did not test a > square exactly around the edges: > https://youtu.be/pgEeMSh4aGA > <https://youtu.be/pgEeMSh4aGA> > JAL PIC demo of library for Nokia 5110 Display > <https://youtu.be/pgEeMSh4aGA> > Demo program showing the functionality of the PIC JAL library of the Nokia > 5110 display.Jallib can be found at: http://justanotherlanguage.org/ > youtu.be > > > I will give it a try this weekend. > > Kind regards, > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens majid > ebru <[email protected]> > *Verzonden:* donderdag 22 juli 2021 11:19 > *Aan:* jallib <[email protected]> > *Onderwerp:* Re: [jallib] when i use KS0108 , the micro reseted ?? > > Hi Ron > > I wrote these codes and micro didn't work > I should change 63 to 55 . > Also I can't write string in position y=55 > I can draw line 55 and write text in 48 ?!? > > On Wednesday, July 21, 2021 at 9:20:31 PM UTC+4:30 [email protected] > wrote: > > Hi Majid, > > Can you simply the program to write once the following: > > glcd_line(0,0,127,0) > glcd_line(0,0,0,63) > glcd_line(127,0,127,63) > glcd_line(0,63,127,63) > > Do you get a box? > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens majid > ebru <[email protected]> > *Verzonden:* woensdag 21 juli 2021 07:56 > *Aan:* jallib <[email protected]> > *Onderwerp:* Re: [jallib] when i use KS0108 , the micro reseted ?? > > I think(feel) zero division happens in micro > Maybe in the file glcd_common or file glcd_ks0108 , i don't know > On Wednesday, July 21, 2021 at 10:24:17 AM UTC+4:30 majid ebru wrote: > > > I think(feel) zero division happens in micro > On Tuesday, July 20, 2021 at 11:42:30 PM UTC+4:30 majid ebru wrote: > > Hi > i use glcd_line but it doesn't work correctly? > > > include 18f4520 > pragma target clock 8_000_000 -- Fosc > pragma target OSC hs > pragma target LVP disabled > -- > -- GRAPHIC_LCD IO definition ------------------------ > var byte GLCD_DATAPRT is portD > var byte GLCD_DATAPRT_DIR is portD_direction > > alias GLCD_CS1 is pin_b0 > alias GLCD_CS2 is pin_b1 > alias GLCD_RST is pin_b2 > alias GLCD_RW is pin_c1 > alias GLCD_E is pin_b3 > alias GLCD_DI is pin_b4 > -- > alias GLCD_CS1_DIRECTION is pin_b0_direction > alias GLCD_CS2_DIRECTION is pin_b1_direction > alias GLCD_RST_DIRECTION is pin_b2_direction > alias GLCD_RW_DIRECTION is pin_c1_direction > alias GLCD_E_DIRECTION is pin_b3_direction > alias GLCD_DI_DIRECTION is pin_b4_direction > > const GLCD_CLIPPING = false -- enable clipping (of > ellipse) > > > enable_digital_io() -- all pins digital I/O > > include delay > include math > include print > include glcd_5x7_font > include glcd_6x8_font > include glcd_font -- common font stuff > glcd_font_use(FONT_5X7) -- activate font > > include glcd_ks0108 -- glcd device > dependent library > include glcd_common -- device independent > glcd library > > glcd_init() -- initialize display > > --------------------------- > glcd_clear_screen() > forever loop > if n < 10000 then block > n = n + 1 > end block > else block > n = 0 > FlashLED1 = ! FlashLED1 > if(FlashLED1)then block > -------------------------------------------------- > glcd_write_pixel(60,i) > glcd_line(0,i,127,i) > glcd_char_goto(50,30) > print_word_dec(glcd,i) > -------------------------------------------------- > i = i + 1 > end block end if > end block end if > end loop > > ------------------------------------------------------------------------------------ > > only draw 56 (0~55) lines ?!? > > On Monday, July 19, 2021 at 9:37:09 PM UTC+4:30 [email protected] wrote: > > Hi Majid, > > I cannot see anything wrong with your code. Did you try to make a box by > writing 4 lines to the screen to see if that works OK? It is not a solution > but a test to see if you can write the lines on 'the edges' of the display. > > Kind regards, > > Rob > > ------------------------------ > *Van:* [email protected] <[email protected]> namens majid > ebru <[email protected]> > *Verzonden:* maandag 19 juli 2021 02:39 > *Aan:* jallib <[email protected]> > *Onderwerp:* [jallib] when i use KS0108 , the micro reseted ?? > > > Hi again > i use this code : > > include 18f4520 > pragma target clock 8_000_000 -- Fosc > pragma target OSC hs > pragma target LVP disabled > -- > -- GRAPHIC_LCD IO definition ------------------------ > var byte GLCD_DATAPRT is portD > var byte GLCD_DATAPRT_DIR is portD_direction > > alias GLCD_CS1 is pin_b0 > alias GLCD_CS2 is pin_b1 > alias GLCD_RST is pin_b2 > alias GLCD_RW is pin_c1 > alias GLCD_E is pin_b3 > alias GLCD_DI is pin_b4 > -- > alias GLCD_CS1_DIRECTION is pin_b0_direction > alias GLCD_CS2_DIRECTION is pin_b1_direction > alias GLCD_RST_DIRECTION is pin_b2_direction > alias GLCD_RW_DIRECTION is pin_c1_direction > alias GLCD_E_DIRECTION is pin_b3_direction > alias GLCD_DI_DIRECTION is pin_b4_direction > > const GLCD_CLIPPING = TRUE -- enable clipping (of > ellipse) > > enable_digital_io() -- all pins digital I/O > include delay > include math > include print > include glcd_5x7_font > include glcd_6x8_font > include glcd_font -- common font stuff > glcd_font_use(FONT_5X7) -- activate font > > include glcd_ks0108 -- glcd device > dependent library > include glcd_common -- device independent > glcd library > > glcd_init() -- initialize display > > --------------------------- > glcd_clear_screen() > var word n = 0 > var byte i = 40 > -- > -- > glcd_box(0,0,127,63) > -- > -- > forever loop > > end loop > > ---------------------- > glcd_box(0,0,127,63) > > this is code doesn't work?? > > but if i change that to glcd_box(0,0,127,55) < this works correctly ? > > can somebody help me ?? > > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/b05ea9ea-8601-44f3-b3b3-d315da0df328n%40googlegroups.com > > <https://groups.google.com/d/msgid/jallib/b05ea9ea-8601-44f3-b3b3-d315da0df328n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/9ad8bb5a-efb7-40a8-beba-8ba193b58a77n%40googlegroups.com > > <https://groups.google.com/d/msgid/jallib/9ad8bb5a-efb7-40a8-beba-8ba193b58a77n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/3a2597be-896c-4240-a7c3-e2acef5e5fa4n%40googlegroups.com > > <https://groups.google.com/d/msgid/jallib/3a2597be-896c-4240-a7c3-e2acef5e5fa4n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > -- > You received this message because you are subscribed to the Google Groups > "jallib" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jallib/AM0PR07MB624118BDEF17668B4889FC30E6E49%40AM0PR07MB6241.eurprd07.prod.outlook.com > > <https://groups.google.com/d/msgid/jallib/AM0PR07MB624118BDEF17668B4889FC30E6E49%40AM0PR07MB6241.eurprd07.prod.outlook.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/780bed41-29d7-4286-b987-f73cc539f642n%40googlegroups.com.
