Shop OBEX P1 Docs P2 Docs Learn Events
Propforth 3.5 includes Low Res VGA — Parallax Forums

Propforth 3.5 includes Low Res VGA

prof_brainoprof_braino Posts: 4,313
edited 2010-11-30 20:13 in Propeller 1
Please notice

PropForth 3.5 is no longer the current release

PropForth 4.0 is available for download

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

Please move propforth discussion to the new thread

http://forums.parallax.com/showthread.php?p=958053#post958053

=-= -=- =-= -=- =-= -=- =-=

Propforth 3.5e is available for download.

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

20101019 NOTICE: current version is now Propforth v3.5e - Adds corrected comment in Propforthpart1.f and example on optimizing in assembler
20101017 NOTICE: current version is now Propforth v3.5c - Hi Res and Low Res VGA work for demoboard and HIVE hardware
20101017 Propforth v3.5b had incorrect version strings. Thanks to the folks that pointed this out.

The standard kernel can be loaded with the Low Res VGA extension.
(Compare to the HiResVGA which has the Hi Res VGA driver built into the modified HiRes VGA kernel)

Low Res VGA has two pages of larger characters in 15 lines of 32 characters. More colors and more attributes are supported

Use (CTL + ALT) to switch between VGA pages

Please check the updated FAQ
«1345

Comments

  • caskazcaskaz Posts: 957
    edited 2010-10-12 03:46
    Hi prof_braino.

    Thanks.
    I did update to PropForth3.5.

    Abount "CTL+A', I refered CogXInstructions inside Wiki.
    http://code.google.com/p/propforth/wiki/CogXInstructions
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-12 04:16
    caskaz wrote: »
    Hi prof_braino.

    Thanks.
    I did update to PropForth3.5.

    Abount "CTL+A', I refered CogXInstructions inside Wiki.
    http://code.google.com/p/propforth/wiki/CogXInstructions

    Updated - Thanks caskaz

    Did the FAQ answer all you questions?

    Also, I sent Sal your SD card code, he was interested. He will be working on the SD and file system access after the high speed inter-prop communications channel is finished.
  • caskazcaskaz Posts: 957
    edited 2010-10-12 04:37
    Hi prof_braino.

    Now I have been reading FAQ of Wiki.

    By the way, I have one question.
    Why does not Salsanci post here?
    At first, I had thought name"prof_braino" was another name for Salsanci.
  • caskazcaskaz Posts: 957
    edited 2010-10-13 06:35
    Hi prof_braino.

    I founfd out strange.
    I made data-table(arrow_data) at top part of file, and word(arrow) at end of file.
    Executed word"arrow", there is "20200000" at top of output.

    I moved data-table(arrow_dat) to near word"arrow". Output is good.
    There is not "20200000".
    Or changed data-table's name(arrow_data) to "a-da", Output is good.
    data-table(arrow_data) is far away word(arrow)
    Cog6 ok
    arrow
    20200000
    -18001
    -18001
    -18001
    -3C001
    -3C001
    -7E001
    -7E001
    -FF001
    -FF001
    -1FF801
    -1FF801
    -3FFC01
    -3FFC01
    -7FFE01
    -7FFE01
    -FFFF01
    -FFFF01
    -1FFFF81
    -1FFFF81
    Cog6 ok
    
    data-table(arrow_data) is near word(arrow)
    Cog6 ok
    arrow
    -18001
    -18001
    -18001
    -3C001
    -3C001
    -7E001
    -7E001
    -FF001
    -FF001
    -1FF801
    -1FF801
    -3FFC01
    -3FFC01
    -7FFE01
    -7FFE01
    -FFFF01
    -FFFF01
    -1FFFF81
    -1FFFF81
    -3FFFFC1
    Cog6 ok
    
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-13 17:25
    caskaz wrote: »
    ?
    Salsanci.

    Sal likes to write code, but does not do well with documentation.
    So he writes code, i write docs . he accepts my suggestions for new functions, and lets me handle user questions. it's much more fun than my job, but doesn't pay as well
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-14 04:14
    caskaz wrote: »

    I founfd out strange.

    I didn't run the code, but my guess is the issue is related to allocating longs
    ...
    ffffffff L,
    ...
    

    inside of fastload (fl).

    -or-

    NOT having a blank line between the end of one colon definition ( ; ) and the start of the next ( : ) when the definitions have \ comments inline

    :code
    code code code \ comment
    code ;
    : code
    code code \ comment
    code
    ;

    Both cases can cause buffer overrun.
  • caskazcaskaz Posts: 957
    edited 2010-10-14 07:13
    Hi prof_braino.

    I made TouchScreen's demo.
    MCP3204(12bit serialA/Dconverter) is used to get value for TouchScreen's position.

    Started TS_demo, caribration for TouchScreen is done at first.
    Bar-graph go up/down to touch up-arroow and down-arrow.
    Quitting to touch inside Bar-graph's square.

    Rewriting vram on LCD is slow on PropForth's word. I think it needs assembler's word.
    I cannot understand to make it yet.
    640 x 480 - 71K
    640 x 480 - 69K
    640 x 480 - 67K
    640 x 480 - 69K
    1165 x 826 - 95K
  • caskazcaskaz Posts: 957
    edited 2010-10-14 17:00
    Hi prof_braino.

    Still incorrect comments in PropForthPart1.f.
    \ > (n1 n2 -- t/f) flag is true if and only if n1 is less than n2 --> if n1 is greater than n2

    \ < (n1 n2 -- t/f) flag is true if and only if n1 is greater than n2 --> if n1 is less than n2

    \ pinout (n1 --) set pin # n1 to an input --> set pin # n1 to an output
  • caskazcaskaz Posts: 957
    edited 2010-10-14 19:47
    Hi prof_braino.

    I have question.
    I did below:
    Cog6 ok
    c" 1 2 3 4 st? " 4 cogx
    Cog6 ok
    
    Although entering CTL+ALT, no change.
    Prompt is still "Cog6 ok".

    How do I change to Cog4?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-14 20:20
    caskaz wrote: »
    Rewriting vram on LCD is slow on PropForth's word. I think it needs assembler's word.
    I cannot understand to make it yet.

    Very impressive work!

    You are correct, if the forth word is too slow, it needs assembler.

    The 'rule of thumb' is: 'Make it work (quickly) in forth, make it FAST in assembler'.

    We were talking about an assembler optimizing page, but this is one of the more advanced topics. We will try to start on it this weekend for you.

    For now, please look at assembler, cogdebug (the disassembler), and LA.f (the Logic Analyzer). These are the materials that will be used in the tutorial on optimizing with assembler. The material is all there, its just not yet commented for the tutorial.

    You know enough to get through most of it on your own, and it might be quicker than waiting for Sal and I to come up with instructions.

    In any case I will post the new page as quickly as possible.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-17 11:18
    Convert Forth Routine to Assembler to Optimize for SPEED

    We have started working on instructions for converting frequently call forth words into assembler to optimize for executions speed. Sal is writing the code, and a tutorial will be posted on Google Code afterward.

    The plan is to provide two examples:
    1) The EEprom words
    The FORTH version of the EEPROM words EEinit, EEstart, EEreadpage, and EEwritepage will be converted to assembler. Any user can do a side by side comparison for change in execution speed. Also, the execution speed may be faster than the EEprom can handle, so a mechanism to slow down the optimized code for a particular EEprom will be included.

    2) Caskaz's LCD program
    User Caskaz has a specific application that may benefit from optimization. Unfortunately, the propforth team does not have access to the hardware, so we can't test it. Even so, Sal has dome some analysis and found that the LCD_OUT routine is the most often called routine, and therefore may benefit from assembly optimization. Sal will take a stab at coverting LCD_OUT to assembler, and the result will be posted later in the week for Caskaz to test.

    Also, the code from post #8 above appears to all run on a single cog. The LCD driver, the touchscreen driver, and the manager portions might benefit from running on different cogs.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-17 12:35
    Propforth v3.5c is posted on google code.

    Hi Res and Low Res VGA are working for both Demoboard and HIVE hardware
    Now with correct version strings

    Thanks to the folks that pointed this out.

    http://code.google.com/p/propforth/downloads/list
  • caskazcaskaz Posts: 957
    edited 2010-10-17 20:11
    Hi pro_braino.

    Do you complete Hive's build?
    If so, you try sd_viewer_1.0 please.
    I checked many times its code.
    But I cannot find out reason COG6 Reset.
    When it quit to check "s"(address) after "u"(File Detail), it occure "COG6 RESET" to restart "viewer".

    When restart sd_viewer, It works finly without sd_init.
    Adding some comments line, no COG6 Reset.
    But sd_viewer finish soon.
  • Brian RileyBrian Riley Posts: 626
    edited 2010-10-18 15:15
    Current PropForth FAQ says
    How to connect to a different cog in the serial terminal, the vga0 display, and the vga1 display?¶
    
    <cog#> >con
    <cog#> >vga0
    <cog#> >vga1
    
    Example: To display cog6 in vga0, cog5 in vga1, and cog4 in console, use:
    
    6 >con
    5 >vga0
    4 >vga1
    
    

    Is this last three lines right?

    cheers ... BBR
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-18 19:15
    Current PropForth FAQ says
    How to connect to a different cog in the serial terminal, the vga0 display, and the vga1 display?¶
    
    <cog#> >con
    <cog#> >vga0
    <cog#> >vga1
    
    Example: To display cog6 in vga0, cog5 in vga1, and cog4 in console, use:
    
    6 >con
    5 >vga0
    4 >vga1
    
    

    Is this last three lines right?

    cheers ... BBR

    No they are wrong, it does what you would think. Fixed. Thanks Brian
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-18 19:18
    caskaz wrote: »
    Hi pro_braino.

    Do you complete Hive's build?
    If so, you try sd_viewer_1.0 please.
    I checked many times its code.
    But I cannot find out reason COG6 Reset.


    When restart sd_viewer, It works finly without sd_init.
    Adding some comments line, no COG6 Reset.
    But sd_viewer finish soon.

    HIVE 004 is complete, your SD slot code is next on my list.

    Do I need anything to set up the card, or can I just use a formatted Fat16 2 gig?
  • caskazcaskaz Posts: 957
    edited 2010-10-19 03:50
    I checked below:
    FAT16: SDSC2G,miniSDSC512M,microSDSC256M
    FAT32: SDHC4G)
    1165 x 826 - 64K
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-19 05:21
    caskaz wrote: »
    Cog6 ok
    c" 1 2 3 4 st? " 4 cogx
    Cog6 ok
    
    Prompt is still "Cog6 ok".
    How do I change to Cog4?
    cog6 is where command was initiated.
    cog4 is where cmd executed.
    with demoboard and hires vga, serial terminal is cog6 and vga terminal displays cog3 on top and cog4 on bottom.
    when cmd is executed on cog6, it sends string to input buffer on cog4 and cog4 interprets.
    COG4 displays result of execution immediately.

    To change serial terminal cog 4, use

    4 >con
  • caskazcaskaz Posts: 957
    edited 2010-10-19 05:34
    Hi prof_braino.

    I use standard ProfForth3.5, not installng vga. (I don't want to install vga.)
    I need to install another file?
    Cog6 ok
    c" 1 2 3 4 st? " 4 cogx
    Cog6 ok
    4 >con
    -- No response --   Need to power-off on proto-board
    
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-19 18:28
    caskaz wrote: »
    Hi prof_braino.

    I use standard ProfForth3.5, not installng vga. (I don't want to install vga.)
    I need to install another file?
    Cog6 ok
    c" 1 2 3 4 st? " 4 cogx
    Cog6 ok
    4 >con
    -- No response --   Need to power-off on proto-board
    

    first do
    cog?
    

    and determine which cogs are running forth. the regular kernel only comes up on 5 and 6 by default. Try:
    Cog6 ok
    c" 1 2 3 4 st? " 4 cogx
    Cog6 ok
    5 >con
    Cog5 ok
    
    

    do
    cog+ 
    

    to start more cogs running forth
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-19 18:32
    caskaz wrote: »
    Hi prof_braino.

    Still incorrect comments in PropForthPart1.f.
    \ > (n1 n2 -- t/f) flag is true if and only if n1 is less than n2 --> if n1 is greater than n2

    \ < (n1 n2 -- t/f) flag is true if and only if n1 is greater than n2 --> if n1 is less than n2

    \ pinout (n1 --) set pin # n1 to an input --> set pin # n1 to an output

    Fixed comments in propforthPart1.f
    Thanks caskaz!
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-19 18:41
    caskaz wrote: »
    LCD is slow on PropForth's word. it needs assembler's word.
    I cannot understand to make it yet.

    Please notice that there is a NEW version of the download JUST FOR YOU! Happy Birthday! (off by a few months)

    In response to your request, Sal wrote an example of how to optimize the EEPROM word into assembler.


    Please locate exampleasm.f in download propforth3.5e

    This should be applicable to the LCD if you used the EEPROM word as a starting point. If you are successful or at least understand it, please help me write the tutorial.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-19 20:31
    caskaz wrote: »
    try sd_viewer_1.0 please.

    When restart sd_viewer, It works finly without sd_init.
    Adding some comments line, no COG6 Reset.
    But sd_viewer finish soon.

    I loaded the code in sd_funct_1.0 but I could not get it to run on the hive hardware. I could not get sd_init to display what is in your log file. The second section (after sdhc=0 ...ST: ) counts from 0 up to FF and stops at "error"

    Hive has
    P10 - Data Out (SD-D0)
    P11 - SCLK (SD-CLK)
    P12 - Data IN (SD-CMD)
    P13 - CS (SD-D3)

    The bit after the - is what the conductors on the SD slot appear to be,
    and the ( ) Is what is labeled on the schematic. So I think I bungled the pin assignments. There are only 15 more combination to try :)

    I will look at it again when I am not so tired.
  • caskazcaskaz Posts: 957
    edited 2010-10-19 20:57
    Hi prof_braino

    Thanks.
    But why "5 >con"?
    Does cog5 execute "st?" of 'c" 1 2 3 st? " 4 cogx'?
    Cog6 ok
    cog?
            Forth cogs: 0 - 6 
    Running Forth cogs: 5 - 6
             Spin cogs: NONE
    Cog6 ok
    c" 1 2 3 st? " 4 cogx
    Cog6 ok
    5 >con
    
    Cog5 ok
    cog+
    
    COG 4 RESET - last status: OK
            Forth cogs: 0 - 6 
    Running Forth cogs: 4 - 6
             Spin cogs: NONE
    
    Cog5 ok
    st?
    ST: 00000001 00000002 00000003
    Cog5 ok
    

    Setting I/O for sd_func_1.0 is below:
    15 constant _sd_cs
    16 constant _sd_di        \ connected SD's di
    17 constant _sd_clk
    18 constant _sd_do        \ connected SD's do
    

    In case of Hive:
    d constant _sd_cs
    c constant _sd_di        \ connected SD's di
    b constant _sd_clk
    a constant _sd_do        \ connected SD's do
    

    Can I purchase Hive's board?
  • caskazcaskaz Posts: 957
    edited 2010-10-19 23:39
    Hi Salsanci & prof_braino.

    I did download propforth3.5e.
    Now I'm watching exampleasm.f.
    How can I get assembler's hex code?

    '16E etc' is COG's memory address?
    How does they define to its address?
    16E asmlabel a_eeread_bytex
       :
    151asmlabel a_eeread_sdai
    

    There are ' jnext' and '_treg5' in assembler list.
    Where is ' jnext' and '_treg5' ?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-20 04:30
    caskaz wrote: »
    But why "5 >con"?
    Does cog5 execute "st?" of 'c" 1 2 3 st? " 4 cogx'?
    Cog6 ok
    cog?
            Forth cogs: 0 - 6 
    Running Forth cogs: 5 - 6
             Spin cogs: NONE
    Cog6 ok
    c" 1 2 3 st? " 4 cogx
    Cog6 ok
    5 >con
    
    Cog5 ok
    cog+
    
    COG 4 RESET - last status: OK
            Forth cogs: 0 - 6 
    Running Forth cogs: 4 - 6
             Spin cogs: NONE
    
    Cog5 ok
    st?
    ST: 00000001 00000002 00000003
    Cog5 ok
    

    I am getting confused on your questions, it looks like you are mixing different ideas?
    5 >con
    

    makes cog5 connected to the console.

    Cog6 ok
    c" 1 2 3 st? " 4 cogx
    Cog6 ok
    

    is a forth prompt connected to cog6, the string:
    c" 1 2 3 st? " 
    

    makes a compiled string in a buffer,
    4 cogx
    

    sends the compiled string (whose address is on the stack )
    to the input buffer off the specified cog, in this case cog4.

    After that, the cog's interpreter takes the string and interprets it.
    So the result is that cog6 told cog4 to put 1 2 3 on its stack, and to execute the st? word.

    Reboot and try again and see if it is reproducible with unique numbers. My only though is that cog5 had the same numbers left on its stack from a previous experiment?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-20 04:32
    caskaz wrote: »
    Setting I/O for sd_func_1.0 is below:
    15 constant _sd_cs
    16 constant _sd_di        \ connected SD's di
    17 constant _sd_clk
    18 constant _sd_do        \ connected SD's do
    

    In case of Hive:
    d constant _sd_cs
    c constant _sd_di        \ connected SD's di
    b constant _sd_clk
    a constant _sd_do        \ connected SD's do
    

    Did I forget to convert to hex again? I knew it would be something silly. I'll try again tonight.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-20 04:40
    caskaz wrote: »

    Can I purchase Hive's board?

    You can add to the order they are making at HIVE project

    http://hive-project.de/board/viewtopic.php?f=5&t=371&start=60

    (google translate helps, maybe it can do japanese)

    in english if you dont speak german,

    http://hive-project.de/board/viewtopic.php?f=18&t=372

    The guys are very nice, and will be please to talk to you.
    drohn235 is especially interested in forth.

    If you have difficulty, I am ordering ten of them. We can work something out.
  • caskazcaskaz Posts: 957
    edited 2010-10-20 06:37
    Hi prof_braino.
    Cog6 ok
    c" 1 2 3 st? " 4 cogx
    Cog6 ok
    5 >con
    
    Cog5 ok
    st?
    ST: 00000001 00000002 00000003
    Cog5 ok
    
    I think c" 1 2 3 st? " is sent to cog4.
    Why are they on stack of cog5?

    After reboot, there is no data on stack of cog5.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-10-20 16:04
    caskaz wrote: »
    Hi prof_braino.
    Cog6 ok
    c" 1 2 3 st? " 4 cogx
    Cog6 ok
    5 >con
    
    Cog5 ok
    st?
    ST: 00000001 00000002 00000003
    Cog5 ok
    
    I think c" 1 2 3 st? " is sent to cog4.
    Why are they on stack of cog5?

    After reboot, there is no data on stack of cog5.

    No, you misunderstand. Of course there is nothing on stack after reboot, you just rebooted.

    Reboot and do the test of running on cog6, ensure that cog4 running and is displayed on the VGA terminal; and that nothing is on stack for cog5.
    Now run the test and use different numbers, like 139, and -81 and check cog5 again. I think 1 2 3 got left from and earlier test.

    If you do not have VGA, this test doesn't make a lot of sense. So make a word that flashes an LED. From your terminal, launch the word on another cog and see that is runs for N flashes. Move to the other cogs and check the stacks. You should see the proper results.
Sign In or Register to comment.