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/f3da9fc0-428d-4841-93a6-5e37c1114ee8n%40googlegroups.com.

Reply via email to