Shop OBEX P1 Docs P2 Docs Learn Events
PropForth 3.2 is available - Page 3 — Parallax Forums

PropForth 3.2 is available

13

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2010-07-31 17:52
    Brian Riley said...
    The FAQ is much clearer now ... great ....

    I have been puzzling over this;

    NOTE
    
    10 base w! / in hex, sets the base to 16 (decimal)
    
    10 base w! / in decimal, sets the base to 16 (decimal)
    
    



    Is this a typo? If it isn't, please explain what I am suppose to learn from it.

    I know that I can use the words hex and decimal to set the base, but is there a word that will cause what the current base value is to be displayed?

    cheers ... BBR

    This is another example of how I earned the name ' braino' ... (as in 'brain?' ... 'NO!')

    The FAQ has been updated to

    NOTE

    10 base w! / set base to whatever base it is in; hex, decimal, octal, binary, etc,; i.e. does nothing

    set the base to decimal or hex using the kernel words

    hex / defined using decimal definition 16 base w!

    and

    decimal / defined using decimal definition 10 base w!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 7/31/2010 7:12:18 PM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-07-31 19:29
    caskaz said...
    hi.
    I made lcd_demo.

    Needing about 10 copy/paste to load on Prop.

    I loaded your code as posted, the fl command worked just fine for me, it was 1 copy and paste operation. What are your serial port settings? Did you reboot the prop before the copy & paste?

    After the fl command completes, LQ020B8UB02_demo.txt leaves 00003741 on the stack. I didn't look closely yet, but this usually means there is an error in your code.

    You could add each definition one by one
    fl
    
    : next-definition ... ;
    
    st? 
    
    
    


    and be sure to check the stack with st? after each new definition, this will show which word has stack problems.

    If you are continuously loading this code and not doing a reboot between each unsuccessful test, eventually you will run out of stack space and get an overflow.

    You could try rebooting each time a test fails, and fl the code to start clean for the next test. Its very quick, and you know the board is in a good state. If a test failed, you have a good chance that something is not in a good state.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 7/31/2010 11:54:39 PM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-07-31 19:56
    caskaz said...
    Hi prof_braino.
    I deleted every comments and spaces character in front of words on LQ020B8UB02_demo. I did copy/paste whole file(adding fl).
    After I paste on TearTerm, fl displayed on TearTerm while blue LED lit on prot board. Then red LED lit. Words are displayed on Tearterm.
    fl  C77 chars many word displayed : LQ020   ..    .. ; Cog6 ok LQ020
    
    COG6 RESET - last status: MAIN STACK OVERFLOW
    Cog6 ok
    


    It shoud load fine because it don't stop loading.
    But not work.

    I copy/paste LQ020B8UB02_demo with 10-lines step by step. This works fine.
    WHY? I don't have idea.

    About "How does font-datas define for PropForth?"
    Sorry, My question was bad.
    for example, PropBasic define font character by using DATA statement. (word for spin)
    How does PropForth?

    1) you don't have to delete comments and spaces to use the fl command, something else is wrong
    2) just because the interpreter accepts the text does not mean your code is correct. If any definition leaves a value on the stack when it should not, there is an error in the code.
    3) When you use the fl command, your text is buffered to EEPROM. Your code has a stack error that happens to work from the command line since that how you debugged it, is my guess based on 1 & 2
    4) new font will be in a next release. The current plan is to scale down the internal font since the bit maps take so much memory. If you want full kanji we have to wait until extended memory support is ready. If you give some example of the bitmaps we can work them into the plans as possible.

    Sorry, I'm going thru the posts in backwards order while watching the kids

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • Brian RileyBrian Riley Posts: 626
    edited 2010-07-31 22:32
    kuroneko said...
    Brian Riley said...
    NOTE
    
    10 base w! / in hex, sets the base to 16 (decimal)
    
    10 base w! / in decimal, sets the base to 16 (decimal)
    
    

    That looks slightly off (probably suffers from copy/paste). If you're in decimal mode then the last word sequence does effectively nothing.

    I posted this in the PropForth 2.7 thread a while back. It displays the current base in decimal. There is also a more verbose word somewhere in this thread.

    : current_base mcwBase dup w@ dup decimal . swap w! ;
    


    Given that a number of words have been renamed the above word should probably now read:

    : current_base base dup w@ dup decimal . swap w! ;
    



    Not quite, but close ... the 'W's need to be capitalized ....

    : current_base base dup W@ dup decimal . swap W! ;
    



    works just fine

    cheers ... BBR

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    The Shoppe at Wulfden
    www.wulfden.org/TheShoppe/
    www.wulfden.org/TheShoppe/prop/ - Propeller Products
    www.wulfden.org/TheShoppe/k107/ - Serial LCD Display Gear
  • kuronekokuroneko Posts: 3,623
    edited 2010-07-31 23:15
    prof_braino said...
    In your code the first question I have is
    variable buffer 3c allot     \ buffer = 64byte
    


    3c(h) is 60(d), this make 61 longs or 244 bytes.
    I was under the impression that allot just allocates bytes. So I'd expect 64 bytes being used in this example (as commented).
  • caskazcaskaz Posts: 957
    edited 2010-07-31 23:45
    Hi prof_braino
    I think allot is byte.
    4c is 76byte.
    I don't have idea why 76byte.
    variable buffer 3c allot
    variable mask
    : test mask buffer - . ;
    
    test
    4c Cog6 ok
    
    


    serial port: COM5
    baud rate: 57600baud
    data: 8bit
    parity:none
    stop bit:1bit
    flow control :none
    I did reboot before copy/paste.

    I did copy/paste LQo20BBUB02_demo_2.
    This file delete every comments and space character in front of word.
    (Except for this form, loading fail by "UNDEFINED WORD".)
    After "st?" while loading, "ST:"diplayed.
    But error occured.
    fl 
    CA1 Cog6 ok
     ..
    word
     ..
    Cog6 ok
    st?
    ST:
    Cog6 ok
     ..
    word
     ..
    Cog6 ok
    st?
    ST:
    Cog6 ok
     ..
    Cog6 ok
    LQ020
    
    COG6 RESET - last status: MAIN STACK OVERFLOW
    Cg6 ok
    
    

    Post Edited (caskaz) : 8/1/2010 12:46:18 AM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-07-31 23:52
    kuroneko said...
    prof_braino said...
    In your code the first question I have is
    variable buffer 3c allot     \ buffer = 64byte
    


    3c(h) is 60(d), this make 61 longs or 244 bytes.
    I was under the impression that allot just allocates bytes. So I'd expect 64 bytes being used in this example (as commented).

    Sorry guys, brain fart again, I was looking at the difference between variable and wvariable.

    You are correct allot is bytes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 8/1/2010 2:52:35 AM GMT
  • kuronekokuroneko Posts: 3,623
    edited 2010-08-01 00:08
    caskaz said...
    4c is 76byte.
    I don't have idea why 76byte.
    variable buffer 3c allot
    variable mask
    : test mask buffer - . ;
    
    test
    4c Cog6 ok
    
    

    That's nothing to worry about. It depends - among other things - on the length of the name of the word. For example, try using verylongwordindeed instead of mask. All you get is the difference of their respective locations in the dictionary which is not necessarily related to their payload(s).
  • caskazcaskaz Posts: 957
    edited 2010-08-01 00:59
    Hi prof_braino.
    I attached TeraTerm_Forth.ini for Teraaterm.
    Please check it.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 01:45
    caskaz said...
    Hi prof_braino
    I think allot is byte.
    4c is 76byte.
    I don't have idea why 76byte.
    variable buffer 3c allot
    variable mask
    : test mask buffer - . ;
    
    test
    
    4c Cog6 ok
    
    



    I think the extra is for the dictionary entry. CFA (code field address) PFA (parameter field address) NFA (name field address)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 01:59
    caskaz said...
    Hi prof_braino.
    I attached TeraTerm_Forth.ini for Teraaterm.
    Please check it.

    Sorry, all I can say is that it's there, I don't know about any of those settings; If you changed anything from the defaults, change it back to the default.

    The only thing that I know about is the serial settings, that what you have listed in the earlier posts look correct.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • caskazcaskaz Posts: 957
    edited 2010-08-01 02:09
    Thanks prof_braino.

    Default for TeraTerm cannot communicate to proto board.
    I changed only below:
    serial port: COM5(changed)
    baud rate: 57600baud(changed)
    data: 8bit(Default)
    parity:none(Default)
    stop bit:1bit(Default)
    flow control :none(Default)
    menu's Setup - Terminal item New-line: Receive CR+LF(changed)
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 02:31
    caskaz said...
    Hi prof_braino
    baud rate: 57600baud
    data: 8bit
    parity:none
    stop bit:1bit
    flow control :none
    I did reboot before copy/paste.

    I did copy/paste LQo20BBUB02_demo_2. This file delete every comments and space character in front of word. (Except for this form, loading fail by "UNDEFINED WORD".) After "st?" while loading, "ST:"diplayed. But error occured.
    LQ020
    
    COG6 RESET - last status: MAIN STACK OVERFLOW
    Cg6 ok
    
    


    Your serial port settings look ok.
    When I load the file as posted, I get no error; no loading fail with "UNDEFINED WORD" message.
    if you see an error loading the code, something is incorrectly configured, possibly on your PC.
    Is anything changed from defaults in teraterm, does any other program use the com port?

    Executing LQ020 causes the cog to reset, so I think there is a problem in LQ020.

    Please execute each word one at a time and verify that each consumes the proper number of values, and leaves the proper number of values. Please consider adding the comments for each word on the line before each definition, that's how Sal does it in PropForthPart1.f , it does not cause the the lines to bunch up.
    For the time being, try keeping comments on a separate line.

    Also, consider making the body of each DO...LOOP into a single word, and debug that word separately.
    : DoThis20Times .... ;
    
    : OUTERLOOP
                       20 0 DO 
                                   DoThis20Times
                           LOOP ;
    
    



    One of the loops is leaving a value on the stack, and happens enough times to fill the stack's 32 longs.
    When I see this in my code, it is always the most complicated word at the very end of the dictionary.

    My guess would be
    disp_pair
    
    


    or later.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 8/1/2010 3:18:35 AM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 02:50
    caskaz said...
    Thanks prof_braino.

    Default for TeraTerm cannot communicate to proto board.
    I changed only below:
    serial port: COM5(changed)
    baud rate: 57600baud(changed)
    data: 8bit(Default)
    parity:none(Default)
    stop bit:1bit(Default)
    flow control :none(Default)
    menu's Setup - Terminal item New-line: Receive CR+LF(changed)

    If it can load words, it must be set up ok.

    Is something different about your PC? Are you working on a fairly modern pc? Some of my ancient machines cannot use 57600 reliably. Also if you have an old Mac running newer OS X emulating windows using WINE and rip DVD at the same time, sometimes things have issues. I'm grasping as straws here, I've run out of ideas.

    Can you do a screen capture of the loading failure and email it to me? Send me a PM if you want my email.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • caskazcaskaz Posts: 957
    edited 2010-08-01 02:50
    Hi prof_braino.

    Doing Copy/pasteLQ020BBUB02_demo step by step, it works fine.
    But doing whole code, UNDEFINED WORD occure.
    It seems there is not problem.

    Doing Copy/paste whole LQo20BBUB02_demo_2 , it load fine.
    But error occured. [noparse][[/noparse]COG6 RESET - last status: MAIN STACK OVERFLOW]
    Same as lcd_initial.

    I will do your suggestion later.

    Thanks.

    caskaz
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 03:08
    caskaz said...
    Hi prof_braino.

    Doing Copy/paste LQ020BBUB02_demo step by step, it works fine.
    But doing whole code, UNDEFINED WORD occure.
    It seems there is not problem.


    SORRY! Made another mistake.

    color_list has comments at the end of each line. This is the problem.

    if you put each comment on its own separate line, the "UNDEFINED WORD" error does not appear.

    : color_list
    color dup
    1f swap W! 2+ dup      
    \ blue
    f800 swap W! 2+ dup    
    \ red
    f81f swap W! 2+ dup    
    \ magenda
    7e0 swap W! 2+ dup     
    \ green
    7fe swap W! 2+ dup     
    \ cyan
    ffe0 swap W! 2+ dup    
    \ yellow
    ffff swap W! 2+ dup    
    \ white
    a18a swap W! 2+ dup    
    \ brown
    fbc0 swap W! 2+ dup    
    \ orange
    f998 swap W!           
    \ pink
    drop
    ;
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 03:30
    LQ020 causes my system to stop responding.

    The initialization words all work with no stack problems, EXCEPT the line with char_start leaves a 0 on the stack from the dup.
    If that is a seed for the 200 0 DO ... LOOP, its clearer if you put it on the DO line, don't hide it in the previous line.
    0 200 0 DO ....

    You DUP before the > and you only DROP if the test is TRUE. Perhaps if you DROP after the THEN?

    That's all I can come up with, it getting later here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • caskazcaskaz Posts: 957
    edited 2010-08-01 05:38
    Hi pro_braino.

    I changed LQ020BBUB02_demo ( not LQ020BBUB02_demo_2) below.
    Trying many times load, it's ok. And it works fine.
    Using "\" with series lines is no good?


    : color_list
    color dup
    1f swap W! 2+ dup      \ blue
                                                <--cr
    f800 swap W! 2+ dup    \ red
                                                <--cr
    f81f swap W! 2+ dup    \ magenda
                                                <--cr
    7e0 swap W! 2+ dup     \ green
                                                <--cr
    7fe swap W! 2+ dup     \ cyan
                                                <--cr
    ffe0 swap W! 2+ dup    \ yellow
                                                <--cr
    ffff swap W! 2+ dup    \ white
                                                <--cr
    a18a swap W! 2+ dup    \ brown
                                                <--cr
    fbc0 swap W! 2+ dup    \ orange
                                                <--cr
    f998 swap W!           \ pink
                                                <--cr
    drop
    ;
    
    
  • caskazcaskaz Posts: 957
    edited 2010-08-01 12:43
    Hi.
    I made sine_wave.
    But very slow.
    Spin is 800msec for 1-cycle.
    PropBasic is 16msec.
    Assembler is 9msec.
    PropForth is 15seconds.
    Is this correct? Somewhere wrong?

    e000 wconstant sine_start
    f001 wconstant sine_end
    variable dT
    
    : sin
    0 pinout       \ output P0 
    18000000 ctra COG!   \ DUTY-single-end APIN=P0
    clkfreq 21f u/ dT L!
    dT L@ cnt COG@ +
    100 0 do
    2000 0 do      \ 0 - 360degree                        
         7ff i and 1 lshift
         i 1000 and 0= if      \ 0 - 180degree or 180 - 360degree                        
              i 800 and 0= if 
                   sine_start + W@ f lshift 7fffffff + frqa COG!     \ 0 - 90degree
                   else
                   sine_end swap - W@ f lshift 7fffffff + frqa COG!        \ 90 - 180degree
                   then
         else
              i 800 and 0= if 
                   sine_start + W@ f lshift 7fffffff swap - frqa COG!     \ 90 - 270degree
                   else
                   sine_end swap - W@ f lshift 7fffffff swap - frqa COG!        \ 270 - 360degree
                   then
         then
         dT L@ waitcnt
         loop
     loop
    ;
    
    
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 20:12
    caskaz said...
    Hi. I made sine_wave. But very slow.
    Spin is 800msec for 1-cycle.
    PropBasic is 16msec.
    Assembler is 9msec.
    PropForth is 15seconds.
    Is this correct? Somewhere wrong?

    First question: Does 1-cycle mean executing the word 'sin' (100 loops of 2000 loops on the inner loop body), or does it mean 1 execution of the inner loop?
    Executing sin on my machine takes 15 seconds also, so I guess you are saying that the Spin routine that does 100 loops of 2000 loops takes 800msec, etc.
    So for this example Spin is about 20 times faster than PropForth. Assembler is 1700 times faster. Wow! I won't stop using forth though, I try not to sin much anyway.

    Based on your post, if you optimize with assembler, the absolute minimum forth execution time will be greater than 9ms. It should be the 9ms + (forth overhead) ms. The optimized execution time is expected to be less than the spin execution time, based on the spin being general purpose and the optimization being special purpose, but this is just a guess.

    1) Overhead of the forth do..loops: 100 loops of 2000 loops of : null ; takes 10 seconds on my machine, which is the majority of the execution time. Clearly you don't want the existing forth do..loop if you need 200,000 iterations in 9ms. Consider optimizing using your assembler looping routine as an example.

    2) Loop body execution time: 15 seconds - 10 seconds loop overhead = 5 second for 200,000 executions. Consider optimizing using the techniques described in the texts e.g. Starting Forth and Thinking Forth which can be found on-line.

    Conclusion: a) PropForth does not appear to be optimized for running large numbers of do...loops. b) The remain code can be optimized to perform an estimated 200,000 iterations in 9ms.

    The forth development 'rule of thumb' is "Get it running quickly using forth, get it to execute fast using assembler". You have it 'running' albeit slowly in forth. Now is the fun of optimizing if you are so inclined. So nothing is wrong 'per se'; optimization (re-factor and/or assembly) has not been completed.

    If you make a 'fast loop' (from your assembler routine), we can add it to the code base; also, I will add optimizing do...loop for speed to the request queue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 20:14
    caskaz said...
    Hi pro_braino. I changed LQ020BBUB02_demo ( not LQ020BBUB02_demo_2) below. Trying many times load, it's ok. And it works fine.
    Using "\" with series lines is no good?

    : color_list
    color dup
    1f swap W! 2+ dup      \ blue
                                                <--cr
    f800 swap W! 2+ dup    \ red
                                                <--cr
    f81f swap W! 2+ dup    \ magenda
                                                <--cr
    7e0 swap W! 2+ dup     \ green
                                                <--cr
    7fe swap W! 2+ dup     \ cyan
                                                <--cr
    ffe0 swap W! 2+ dup    \ yellow
                                                <--cr
    ffff swap W! 2+ dup    \ white
                                                <--cr
    a18a swap W! 2+ dup    \ brown
                                                <--cr
    fbc0 swap W! 2+ dup    \ orange
                                                <--cr
    f998 swap W!           \ pink
                                                <--cr
    drop
    ;
    
    


    I'm opening a bug report on using / after lines of code, Sal will look at this for the version3.2 patch he is making.

    http://code.google.com/p/propforth/issues/list

    Issue 9 has been submitted

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 8/2/2010 7:28:54 PM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-01 20:19
    The whole reason for the fl [noparse][[/noparse]file load] command is no flow control to the prop.

    I saw something about having the terminal program wait for each character to echo before send the next character. This would solve the whole issue with pasting test to the propforth interpreter, and eliminate the need for the fl word.

    Does anybody know how to set this up in teraterm, or of a terminal program that does this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • caskazcaskaz Posts: 957
    edited 2010-08-01 23:12
    Thanks prof_braino.

    I'm amazed a little because sine_wave takes much time for PropForth.
    Can I make word using assembler?
    I take an interesting in calculation of stack for Forth.
    It is fun to think data on stack. I often mistake.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-02 02:39
    caskaz said...
    Thanks prof_braino.

    I'm amazed a little because sine_wave takes much time for PropForth.
    Can I make word using assembler?
    I take an interesting in calculation of stack for Forth.
    It is fun to think data on stack. I often mistake.

    Me too, but yours is the first post to point this out, maybe there is something we are missing; maybe do...loop itself can be optimized.

    The propforth 2.6 archive has the forth assembler, written in forth
    code.google.com/p/propforth/downloads/detail?name=PropForth2.6archive.zip&can=2&q=

    This page has the disassembler and debugger
    code.google.com/p/propforth/wiki/CogDebuggerDisassembler

    You are the first to try it, you will probably have questions and find errors. Please post or PM and I will try to get fix any issues.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-02 19:25
    caskaz said...
    Hi. I made sine_wave. But very slow.
    Spin is 800msec for 1-cycle. PropBasic is 16msec. Assembler is 9msec. PropForth is 15seconds.
    Is this correct? Somewhere wrong?

    : sin  .... ;
    


    http://code.google.com/p/propforth/issues/list

    Issue 10 has been submitted

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-03 02:56
    caskaz said...
    Hi prof_braino. About "How does font-datas define for PropForth?"
    Sorry, My question was bad. for example, PropBasic define font character by using DATA statement. (word for spin)
    How does PropForth?

    Propforth would use the same method as in assembler, as in the custom font in the 1024x768 HiRes VGA example in the OBEX.

    are you trying to get just afew characters, a full ASCII font, or an extended Asian font?

    A full ASCII font would take up most of the memory in prop, so on the single prop implementations, the internal font is used. Sal is checking to see if the forth dictionary and a custom font can fit; it does not look like there is enough RAM. We are also looking at what we can do with extended memory, but there are no definite results yet. The C3 is the platform we are looking at.

    For serial output, you can output any multi-byte codes you need, and use the font that is active in the host terminal to deal with the actual bit maps.

    In the case of an LCD display, if the LCD supports programmable fonts, and the font is pre-loaded, you coud again sent out the byte codes and let the LCD deal with the bit maps.

    If you want a full custom font for your LCD project and the LCD does not support programmable fonts, consider having a chip dedicated to the the VGA. There are multi-prop solutions that should be convenient. The Hive is the platform we are looking at

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
  • caskazcaskaz Posts: 957
    edited 2010-08-03 06:09
    Hi prof_braino.

    Sorry, I can't understand well.
    PropForth is impossible to do define font(using DATA statement) like PropBASIC?
    LCD module don't has fonts.

    In case of defining font, external memory needs?
  • kuronekokuroneko Posts: 3,623
    edited 2010-08-03 07:13
    caskaz said...
    PropForth is impossible to do define font(using DATA statement) like PropBASIC?
    Normally you can define (constant) data arrays like this:
    create my_array 0 , 1 , 2 , 3 , 42 ,
    
    Executing my_array will put its address on the stack and you can access the members from there. Unfortunately this doesn't seem to work under PropForth. While it has words like l, w, c, cog, the resulting dictionary entry (my_array) doesn't work as expected (for starters it doesn't leave its address on the stack).

    @prof_braino: Any insight in this one?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-03 13:35
    kuroneko said...
    caskaz said...
    PropForth is impossible to do define font(using DATA statement) like PropBASIC?
    Normally you can define (constant) data arrays like this:
    createmy_array0,1,2,3,42,</CODE>
    Executing my_array will put its address on the stack and you can access the members from there. Unfortunately this doesn't seem to work under PropForth. While it has words like l, w, c, cog, the resulting dictionary entry (my_array) doesn't work as expected (for starters it doesn't leave its address on the stack).

    @prof_braino: Any insight in this one?

    Looks like a bug, since create is defined as leaving the 'created' word's data field on the stack. I will open an issue report for this.

    [UPDATED 2010-08-26 see FAQ http://code.google.com/p/propforth/wiki/PropForthFAQ for CREATE word using 'inherent' PFA rather than explicit PFA, please provide feedback if this is a problem]

    I think the values placed in the array using
    NNNw,</CODE> can still be modified, if you want CONSTANT, not variable, I think you need to use literals (litw, litl); but I haven't tried these, since I usually don't.

    In the meantime, can you use
    wvariablemy_array1w,2w,3w,42w,

    'my_array20dump
    </CODE>

    shows that 0 is in the first location as your create definition wanted. You can access the other values by offset same as with the create'd my_array


    Edit: Issue 12 has been opened http://code.google.com/p/propforth/issues/list

    Even the best needles are not sharp at both ends.

    Post Edited (prof_braino) : 8/3/2010 2:09:21 PM GMT
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-08-03 14:44
    caskaz said...
    Hi prof_braino.

    Sorry, I can't understand well.
    PropForth is impossible to do define font(using DATA statement) like PropBASIC?
    LCD module don't has fonts.

    In case of defining font, external memory needs?

    Nothing is 'impossible', but most things 'haven't been done yet'. Nobody has asked to 'define font(using DATA statement) like PropBASIC' before, so this has not been done (yet).

    I usually don't define fonts, but memory need can be calculated:
    How many characters are in your font?
    How big are the bitmap images?

    For each character, bits high * bits wide = character bitmap size
    bitmap size * number of character = memory need for your font.

    Routines to access the font elements can be written in forth, but VGA needs the data very quickly, so these routines are usually written in assembler for speed.

    If you have gotten your LCD to display your fonts using PropBasic, then can you just use the PropBasic? If you need to interactively test something, can you use you propbasic program as an example for creating the forth code?

    Otherwise, can you give more specific information on what you are doing? I don't know your hardware, your character set, your font size, or your resources available. This information would make it easier to determine possible solutions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Even the best needles are not sharp at both ends.
Sign In or Register to comment.