The glcd issue on the jallist, which stated that graphics works, but
character not surprised me since I tested it at the time. However I
seem to have missed some enhancments on the lib. Seb, could you look
into this issue (and while you're at it, add your name to the lib ;) ?
Thanks,
Joep
Yes, glcd_common.jal does need lcd_write_char, which is defined in
glcd_ks0108.jal.
Which are you haveing trouble with? I guess I didn't see your
question.
-- Title: Test program shows Conway's 'game of life' on a ks0108 graphic LCD
-- Author: Joep Suijs, Copyright (c) 2008-2011, all rights reserved.
-- Adapted-by:
-- Compiler: >=2.4m
-- Revision: $Revision: 2760 $
--
-- This file is part of jallib (http://jallib.googlecode.com)
-- Released under the ZLIB license (http://www.opensource.org/licenses/zlib-license.html)
--
-- Description:
-- http://en.wikipedia.org/wiki/Conway's_Game_of_Life
--
--
-- This file has been generated from:
-- * board: board_16f877a_startersguide.jal
-- * test : test_glcd_ks0108.jal
--
-- (and then ported to the 16f723a, the serial (and some other) stuff commented out,
-- and set up to use the int osc, by Piers Goodhew, August 2011)
--
;@jallib section chipdef
-- chip setup
include 16f723a
-- configuration memory settings (fuses)
pragma target clock 4_000_000 -- xtal frequency
pragma target OSC INTOSC_NOCLKOUT -- internal to start with I think
pragma target PLLEN F16MHz -- int osc PLL enabled (higher frequencies)
pragma target WDT disabled -- no watchdog
pragma target DEBUG disabled -- no debugging
pragma target MCLR external -- reset externally
-- GRAPHIC_LCD IO definition
var volatile byte GLCD_DATAPRT is portc
var volatile byte GLCD_DATAPRT_DIR is portc_direction
var volatile bit GLCD_RW is pin_a4
var volatile bit GLCD_CS1 is pin_a2
var volatile bit GLCD_E is pin_a5
var volatile bit GLCD_DI is pin_a3
var volatile bit GLCD_RST is pin_b0
var volatile bit GLCD_CS2 is pin_a1
var volatile bit GLCD_RW_DIRECTION is pin_a4_direction
var volatile bit GLCD_CS1_DIRECTION is pin_a2_direction
var volatile bit GLCD_E_DIRECTION is pin_a5_direction
var volatile bit GLCD_DI_DIRECTION is pin_a3_direction
var volatile bit GLCD_RST_DIRECTION is pin_b0_direction
var volatile bit GLCD_CS2_DIRECTION is pin_a1_direction
include print
include random
OSCCON_IRCF = 0b01 -- Clock to 4MHz (TODO: lose if we're on xtal)
include delay
include glcd_5x7_font
include glcd_font
include glcd_ks0108
include glcd_common
glcd_init()
glcd_font_use(FONT_5X7)
const byte str1[] = "Test graph display. " -- define a string
;print_string(serial_hw_data, str1) -- output string
;glcd_box ( 0,0, 127,63)
include print
glcd_char_y_pos = 20;
glcd_char_x_pos = 20
;glcd_line(0, 0, 32, 63)
;glcd_line(0, 0, 64, 63)
;glcd_line(0, 0, 127,63)
print_string(glcd, str1)
glcd_box( 0,0, 127,63)
delay_100ms(10)
forever loop
delay_100ms(5)
-- fill with chars
var byte x, y, char;
char = 32
for 8 using y loop
glcd_char_goto(0, (y+1) * _glcd_font_current_height )
for 25 using x loop
glcd = char
char = char + 1
if (char > 122) then char = 32 end if
end loop
end loop
;serial_hw_data = "+"
end loop
Joep
2011/8/19 Piers Goodhew <pie...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/jallib/-/49QjHNp1sukJ.
> To post to this group, send email to jal...@googlegroups.com.
> To unsubscribe from this group, send email to
> jallib+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/jallib?hl=en.
>
That comment is indeed obsolete. It's easy to remove this and
regenerate the samples. Just say the word and I will take care
The point is this does not fix the issue and I am not able to do
actual testing on this code. I also do not understand why this sample
seems to pass buildbot if there is a missing procedure..
> - removing the "g" from glcd_write_char (in glcd_ks0108) results in big
> white blocks, not chars (some bug further up in the pbp routine?)
There is no "g"in glcd_write_char (in glcd_ks0108). It should be
glcd_write_char (not lcd_write_char). I don't think block writes are
working for ks0108. I scanned through the code and ''glcd" pseudo var
should be working if you name the procedure glcd_write_char.
You can test glcd_write_char on it's own to see if it works. For
example:
glcd_write_char(0,0,"A") -- write character "A" at 0,0.
2011/8/19 Piers Goodhew <pie...@gmail.com>:
>
> It falls back to another procedure if glcd_write_char is missing, so I
> suspect that's why it passes.
I guess that that must be it, but that seems to be fall-back to a
non-working routine.
Anyway - I fixed the comment and regenerated three samples, which
means they compile with the current svn code base. I could not figure
out what has happened since my last test (somewhere last year) and I
am afraid this did not yet fix code.I hope this will be resolved
shortly. If not, I'd probably be able to have a test-board available
and work on it in a month or so.
Joep
It would be interesting to know how it resolves such a missing
procedure. We know it does, since there we can generate samples. I saw
some conditional compile stuff, maybe that's related?
Joep
Piers, you will only be able to use fonts that are less then 8 pixels
high unless you modify glcd_write_char and add more fonts.
It looks to me that KS0108 may be slow to draw shapes, images etc.
Maybe you can let us know how performance is.
Le 21 août 2011 14:11, "mattschinkel" <mattsc...@hotmail.com> a écrit :
> Seb, instead of giving same naming prodecures in lcd device libs like
> 'glcd_write_char', we could name them like 'ks0108_write_char' then do
> an alias during the include block in the sample.
IIRC we did things like this to idenntify, within API, which proc are device specific, and which are generic. things go like this for other glcd lib as well. during refactoring I try to maintain existing api but renamed ks108_.
cheers
seb
data = data | !( 1 << yy )
data = data & !( 1 << yy )
Having said this, this bug has been there for a long time and I am
sure the sample file did work despite of this. So what has changed by
the refactoring what made the sample fail? With this answer, we can
judge if the sample still works as expected and if it needs adaption
or extension...
Joep
2011/8/27 Piers Goodhew <pie...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/jallib/-/ZrI3-giLy2UJ.
@Mike:
Iirc you supplied quite a lot of alternative (improved, extended &
modified) code, but nobody (including you and me) spent the time and
effort to figure out the relevant parts and integrate them properly
into jallib.
You are right about the performance of the pixel routine (see my
remark above). However, replacing it by a byte-oriented routine will
limit us to fonts of 8 bits high. And in addition to this, the fonts
can only be placed on rows that are multiples of 8. So I'd prefer a
flexible routine over a limited one. In an ideal case, there would be
an option to use the byte-oriented one automagicly when possible and
revert to the bit one when required. This does require significant
testing e.g. to check if 8-bit and other-sized fonts are printed
properly at any place on the screen. And with the integration of the
other glcd libs, I'm not sure if this affects this lib only, or can
(should) be generic implemented and tested on other graphic displays
too.
Joep
2011/8/28 Piers Goodhew <pie...@gmail.com>:
> Off the top of my head, I wonder if tests were passed because pixel erasing
> was not tried and the ks0108_write_char routine was the only one used ...
> PG
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/jallib/-/OPxyL3T0eg0J.
> Belatedly confirming that the current svn build produces visible text output
> when I point my modified-for-16f723a "glcd_ks0108" sample at it.
Thanks for the feedback!
> Right off the bat, Mike: is there any reason you're doing this
> if y > 191 then
> y = y -192
> elsif y > 127 then
> y = y - 128
> elsif y > SCREEN_MAX_Y then
> y = y -SCREEN_ROWS
> end if
>
> rather than:
> y = y & 63 -- or equivalent constant
Check with y=180 (not sure if it is an intended difference though).
Joep
> rather than:
> y = y & 63 -- or equivalent constantCheck with y=180 (not sure if it is an intended difference though).
#! /usr/bin/ruby
SCREEN_MAX_Y = 63
SCREEN_ROWS = 64
def three_ifs_way(y)
if y > 191 then
y = y - 192
elsif y > 127 then
y = y - 128
elsif y > SCREEN_MAX_Y then
y = y - SCREEN_ROWS
end
return y
end
def one_AND_way(y)
return y & 63
end
#### main loop
return_value = 0
for i in 0..255
if three_ifs_way(i) != one_AND_way(i) then
puts "Bad! Methods differ for value #{i}"
return_value += 1
end
end
While adding comments to the math library I think I found an error in
one of the routine:
> -- Original: Michael Watterson
> function round_fixed(sword in fixed_point) return sbyte is
> if ((fixed_point & 0x10) > 0) then -- 128 and more = 0.5
> return (sbyte(fixed_point >> 8) + 1)
> else
> return (sbyte(fixed_point >> 8))
> end if
> end function
I think the 'if' statement should be:
if ((fixed_point & 0x80) > 0) then
Do you agree or do I misunderstand the fixed point notation?
Regards, Rob.
--
R. Hamerling, Netherlands --- http://www.robh.nl
Could that be the notation
<sbyte>.<sbyte>
which I did not copy to print_scalable?
Greets,
Kiste
I think the fixed point notation in math.jal is <sbyte>.<byte>
On 25-11-11 11:46, Oliver Seitz wrote:
> which I did not copy to print_scalable?
I had a quick look in print_scalable and found not a single procedure
documented the way is should be according to Jalapi recommendations. Not
that print.jal is any better!!! And there are more libs requiring
improved docs!
Are you still working on print_scalable? Then please add comments such
that Jalapi will generate proper cocimentation files and a first time
user understands how to work with the procedures and functions.
--- Rob Hamerling <robham...@gmail.com> schrieb am Fr, 25.11.2011:
> Von: Rob Hamerling <robham...@gmail.com>
> Betreff: [jallib] print_scalable
> An: jal...@googlegroups.com
> Datum: Freitag, 25. November, 2011 12:19 Uhr
>
> Hi Kiste,
>
> On 25-11-11 11:46, Oliver Seitz wrote:
>
> > which I did not copy to print_scalable?
>
> I had a quick look in print_scalable and found not a single
> procedure documented the way is should be according to
> Jalapi recommendations. Not that print.jal is any better!!!
I have to admit that I only took care to keep compatibility with print.jal. I did not think of first time users yet...
> Are you still working on print_scalable? Then please add
> comments such that Jalapi will generate proper cocimentation
> files and a first time user understands how to work with the
> procedures and functions.
It is on my to-do list, but JAL in general sits on a very low priority these days. That will hopefully change some day.
Greets,
Kiste