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

Propforth 3.5 includes Low Res VGA

124

Comments

  • caskazcaskaz Posts: 957
    edited 2010-11-22 16:45
    Hi.
    I checked P0 by oscilloscple.
    There is only one High pulse.(pulse-width is about 300usec)
    Executed 'a_pulse'.

    I added 'jnext' at asembler code's end.
    And I changed value of _treg5 to 200.
    But no change. There is only one High pulse.(pulse-width is about 300usec)

    Why does pulse-width change?
    Why only one High pulse?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-22 18:36
    caskaz wrote: »
    Why does pulse-width change?
    Why only one High pulse?

    I sent your questions to Sal, he should be back this week.

    I'm not so good with the assembler.

    We'll talk on Sunday if he doesn't reply before then.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-22 18:50
    caskaz wrote: »
    Hi prof_braino.

    I added comments to sources.
    And I made PDF.
    I think you feel a little strange because my english is japanease-english.

    sd-viewer can initialize your SD-CARD?
    message is SDSC seccess?
    I think sd_init don't works finely on your 2G/4G.
    or collect_info may collect information finely.

    Both can't display csd/cid?

    Did you format SD-CARDS by Windows?
    Formatted by Windows, I think its SD-CARD don't work finely on sd_viewer.

    Pleaase send your log.

    Thanks for the documentation, it will help very much.
    You English is fine, I talk to Americans all day, so I'm used to it.

    sd_init works fine on
    1Gig - SDSC initialize success
    2Gig - SDSC initialize success
    4Gig - SDHC initialize success

    All were formatted on windows

    Should I try reformatting on a camera, etc?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-22 19:28
    Test Logs for
    Transend 1G microSD
    Transend 2G microSD
    Kingston 4G microSD
  • caskazcaskaz Posts: 957
    edited 2010-11-22 20:39
    Hi prof_braino.

    Thanks for logs.
    It seems reading for csd/cid is ok.

    Can you format SD-card by SD-maker's utility?

    I also check to format SD(512MB).
  • caskazcaskaz Posts: 957
    edited 2010-11-22 23:21
    Hi prof_braino.

    I formatted pqi256MB by WindowsXP.
    I checked csd/cid/MBR/FAT/RDE.

    "reservedSectors" of SD-card information changed from 0x1 to 0x6.
    And address for FAT/RDE also changed.
    But obtained datas is ok.

    I reformatted pqi256MB by another device(handy telephon).
    "reservedSectors" of SD-card information is back to 0x1.

    Did you format SD by Windors/DOS?
    Cluster size is 16kB?
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-23 04:49
    caskaz wrote: »
    Did you format SD by Windors/DOS?
    Cluster size is 16kB?

    Possibly SD 1G was preformatted, and not formatted by Windows.
    The others used windows defaults.

    Unfortunately I was not paying attention.

    I will look for manufacturer's format utility and try again.

    It looks like you are onto the trail of the bug!
  • caskazcaskaz Posts: 957
    edited 2010-11-23 06:00
  • mwalimumwalimu Posts: 44
    edited 2010-11-23 10:57
    I've been trying to figure out how to set up a serial port other than the port used to communicate with Propforth. I'm looking to connect a protoboard to my iRobot Create.

    FORTH can be pretty hard to follow, I'm just looking for clear directions.
  • salsancisalsanci Posts: 14
    edited 2010-11-23 14:16
    \ Added some comments and a few corrections, hope this helps
    \
    \
    fl

    0 wconstant _data
    1 _data lshift constant _datam

    \ ********SAL assembler with jnext, and load of _treg6 ...
    153 asmlabel a_pulse
    lockdict variable def_014F 015B l, 014F l,
    00000001 l, A0FE1A10 l, E4FE1B51 l, 5C7C0000 l, 68BFED4F l, A2FE1D00 l, 7CBFE94F l, 5CFEA550 l, 78BFE94F l, 5CFEA550 l,
    E4FE1D55 l, 5C7C0075 l,
    freedict


    \ 152 asmlabel a_pulse
    \ lockdict variable def_014F 0159 l, 014F l,
    \ 00000001 l,
    \ E4FE1B50 l,
    \ 5C7C0000 l,
    \ 68BFED4F l,
    \ A27E1D00 l,
    \ 7CBFE94F l,
    \ 5CFEA350 l,
    \ 78BFE94F l,
    \ 5CFEA350 l,
    \ E4FE1D54 l,
    \
    \ freedict

    \ def_014F lasm

    \ : test 100 0 do a_pulse loop ;

    \ ********SAL, do the lasm in a word, fl uses multiple cogs, and you can load the assembler in another cog
    \ better to execute this if the code once, or in a initialization word on the same cog, really important when
    \ you execute on another cog, note that I changes the number of times it loops, 100 (256 decimal) is very quick

    : test def_014F lasm 1000000 0 do a_pulse loop ;


    \ ********SAL
    \ if you load LogicAnalyzer first, you can run the test on cog 5, and the LogicAnalyzer to look at the signal on cog 6

    : LAtest 5 cogreset c" test" 5 cogx 0 triggerPin W! sampleTrigger ;
    : LAtest4 5 cogreset c" test" 5 cogx 0 triggerPin W! sampleFourTrigger ;
    \ this is a sample every 40 clock cycles, the other is every 4 cycles
    \
    \ LAtest
    \
    \ 00--__-__--__-__--_--__--_--__-__--__-__--_--__--_--__-__--__-__--__-__--_--__--_--__-__--__-__--__-__--_--__--_--__-__--__-__--_--__--_--__-__--__-__--__-__--_--
    \
    \ 01________________________________________________________________________________________________________________________________________________________________
    \
    \ 02________________________________________________________________________________________________________________________________________________________________
    \
    \ 03________________________________________________________________________________________________________________________________________________________________
    \
    \ 04________________________________________________________________________________________________________________________________________________________________
    \
    \ 05________________________________________________________________________________________________________________________________________________________________
    \
    \ 06________________________________________________________________________________________________________________________________________________________________
    \
    \ 07________________________________________________________________________________________________________________________________________________________________
    \ Prop0 Cog6 ok
    \ LAtest4
    \
    \ 00_____________________
    ______________________
    ______________________
    ______________________----______
    \
    \ 01________________________________________________________________________________________________________________________________________________________________
    \
    \ 02________________________________________________________________________________________________________________________________________________________________
    \
    \ 03________________________________________________________________________________________________________________________________________________________________
    \
    \ 04________________________________________________________________________________________________________________________________________________________________
    \
    \ 05________________________________________________________________________________________________________________________________________________________________
    \
    \ 06________________________________________________________________________________________________________________________________________________________________
    \
    \ 07________________________________________________________________________________________________________________________________________________________________
    \Prop0 Cog6 ok


    {
    fl

    :asm
    __1datam
    _datam

    \ ********SAL a label must be alone on a line, fill put an error message in PropForth 4.0
    \__Edelay mov _treg5 , # 10
    __Edelay
    mov _treg5 , # 10
    __C
    djnz _treg5 , # __C

    __Ddelayret
    ret

    a_pulse
    \ set __1datam to output
    or dira , __1datam

    \ set loop-counter to 100
    \ ********SAL this sets the wz flag to zero, but does not set _treg6
    \ mov _treg6 , # 100 nr wz
    mov _treg6 , # 100 wz

    __F
    \ set __1datam to high
    muxnz outa , __1datam
    jmpret __Ddelayret , # __Edelay

    \ set __1datam to low
    muxz outa , __1datam
    jmpret __Ddelayret , # __Edelay

    djnz _treg6 , # __F

    \ *******SAL needs a jnext here
    jnext

    ;asm
    }
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-23 18:21
    mwalimu wrote: »
    I've been trying to figure out how to set up a serial port other than the port used to communicate with Propforth. I'm looking to connect a protoboard to my iRobot Create.

    FORTH can be pretty hard to follow, I'm just looking for clear directions.

    What do you have in mind? Something like a MAX232?

    I'm not familiar with the iRobot, what does it expect from a connection?

    If you could link to the datasheets, that would help get us started.
  • caskazcaskaz Posts: 957
    edited 2010-11-23 19:09
    Hi salsanci.

    Thanks for your help.
    It works finely.

    My asm.f usage also made a mistake.
    At first, I loaded setting of _datam.(0 wconstant _data 1 _data lshift constant _datam)
    Next, I loaded asm.f.
    Next I loaded asembler source.

    Result is below:

    153 asmlabel a_pulse
    lockdit variable def_014F 015B l, 014F l,
    00000001 l,
    A0FE1A10 l,
    E4FE1B51 l,
    5C7C0000 l,
    68BFED4F l,
    A2FE1D00 l,
    7CBFE94F l,
    5CFEA550 l,
    78BFE94F l,
    5CFEA550 l,
    E4FE1D55 l,
    5C7C0075 l,

    freedict

    It's lockdit.
  • salsancisalsanci Posts: 14
    edited 2010-11-24 07:35
    Of course it should be lockdict.

    I have encountered occasionally conditions where my terminal program will drop a character. At first I thought it was a bug in PropForth, but I have correlated it to when I am running teraterm, or other terminal on a single core CPU, or on a very busy system.


    The last year, I have been running on a netbook, not really powerful, but it does have 2 hardware threads. I am also careful about what is running on the system.

    I have not seen this problem ever occur again.

    Please let me know if you are able to isolate / reproduce this issue again.
  • caskazcaskaz Posts: 957
    edited 2010-11-24 16:25
    Hi salsanci.

    After loading asm.f, somtimes(not often) 'lockdict' become to 'lockdit' to load below;
    fl
    
    0 wconstant _data
    1 _data lshift constant _datam
    
    :asm
    __1datam
              _datam
    
    __Edelay  
              mov  _treg5 ,   # 10
    __C
              djnz _treg5 ,   # __C
    
    __Ddelayret
              ret
    
    
    a_pulse
    \ set __1datam to output
    
              or        dira ,     __1datam
    
    \ set loop-counter to 100
    
              mov       _treg6 ,    # 100   wz
    __F 
    \ set __1datam to high 
    
              muxnz     outa ,     __1datam
              jmpret    __Ddelayret , # __Edelay
              
    \ set __1datam to low
    
              muxz      outa ,     __1datam
              jmpret    __Ddelayret , # __Edelay
    
              djnz      _treg6 ,  # __F
    
              jnext
    
    ;asm
    
    
    I use PropForth3.5. PC is Dell's Inspiron1525.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-24 18:08
    caskaz wrote: »
    Hi prof_braino.
    I updated.

    Hi caskaz

    I don't want to sound too picky, but when you post a new version, could you please BUMP the VERSION number each time? Even is the actual contents of the file are the same, please bump the number.

    Right now there are at least three versions that are 2.1. Only one should be 2.1, the next should be 2.2, the next 2.3 and so on. The dates help, but the version number is what needs to change. Otherwise its hard to figure out whats what.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-24 18:26
    @caskaz

    The recent post sd_viewer_21_20101123-1041.zip has a new error, now the 1G card no longer is read correctly; the 'U' command gives 'no file' message.

    2G and 4G cards give same messages as sent in logs.


    :(
  • caskazcaskaz Posts: 957
    edited 2010-11-24 20:10
    Hi prof_braino.

    Sorry,I check sd_viewer as soon.


    I tested sd_viewer_21_20101123-1041 by my SD-CARD(4G,2G,512M,256M).
    I have no idea why your SD don't work.

    I checked logs you sent(I think It use sd_viewer_21_20101122-1144) again.
    About 1G:
    no problem

    About 2G:
    bug is "ManufactyreDate 200A/6 on cid".
    It seems MBR(Master Boot Record) display BTB-area, becuase there is character"MSDOS5.0 FAT16".
    BTB don't actually display BTB, because BTB's sector-end is not "55 AA".
    Datas of SD-card Information is mistake.


    About 4G:
    "firstSectorNumbers"is 0x200 on MBR's address 0x1c6.
    But "firstSectorNumbers"is 0xF9 on SD-card Information.
    "rootDirCluster" on SD-card Information is 0x20202020. This value should be generally 0x2.


    Again I modified as based "sd_viewer_21_20101122-1144".
    I will update as sd_viewer_2.2 later.
    Do you re-format 1G/4G by maker utility?
    Same result although using "sd_viewer_21_20101122-1144"?


    Please drop "sd_viewer_21_20101123-1041".
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-24 23:26
    caskaz wrote: »
    Hi prof_braino.
    I will update as sd_viewer_2.2 later.
    Do you re-format 1G/4G by maker utility?
    Same result although using "sd_viewer_21_20101122-1144"?

    Sorry, long day, forgot maker utility.
    I'll get that tomorrow (after holiday)

    Thanks for your hard work!
  • caskazcaskaz Posts: 957
    edited 2010-11-25 03:39
    Hi prof_braino.

    I'm checking sd_viewer_21_20101123-1041 and sd_viewer_21_20101122-1144.
    I don't understand "'U' command gives 'no file' message" on your 1G SD-CARD bysd_viewer_21_20101123-1041 .
    I have question.
    1G-SD dosen't also display RDE's 512byte block using sd_viewer_21_20101123-1041?

    Your SD's 4 pull-up-resister is 10K?
  • mwalimumwalimu Posts: 44
    edited 2010-11-25 09:24
    What do you have in mind? Something like a MAX232?

    I'm not familiar with the iRobot, what does it expect from a connection?

    If you could link to the datasheets, that would help get us started.


    Nothing too complicated. An Create or Roomba is controlled via simple serial connection at a baud rate of 57k. You could think of it as a slave device. You send a command and the Create performs an action that may include sending sensor data. The idea would be to have one cog handle the communications with the Create.

    Basically I want to:

    1) open an independent serial line to the Create. It would work exactly like the serial lines that talk to COG 7 over pins 31 and 30.

    2) set up a cog to monitor data from the Create and send the occasional command to it. I figure I would set up shadow registers on the Propeller (the Create has various sensors, bump switches, battery power, over current sensors, etc) that could be read from other cogs.

    It sounds similar to what you are trying to do with the Hive, serial connections between Props.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-25 09:39
    mwalimu wrote: »
    Nothing complicated. A...controlled via serial ... baud rate of 57k.
    1) serial line to the Create. exactly like COG 7 over pins 31 and 30.

    2) cog to monitor Create and send command.

    It sounds similar to what you are trying to do with the Hive, serial connections between Props.

    OK, easy, a couple points:
    - next version on propforth should have ability to have N-serial connections. The max232 hardware is optional, only needed if the ex. distance requires it
    - High speed serial between cogs is different, these are high speed synchronous, continuous communications for making several props seem like one big prop.

    Please look for kernel version 4 information either this week or next week.

    I would like to nominate YOU as Guinea pig for testing, if you are interested.
  • mwalimumwalimu Posts: 44
    edited 2010-11-25 19:22
    OK. I'll be a lab rat.
  • caskazcaskaz Posts: 957
    edited 2010-11-26 05:45
    Hi prof_braino.

    I updated to sd_viewer_2.2.
    I tested 6 SD-CARD.
    Only 1G-SD(Panasonic) didn't work to display CID/CSD.
    1G-SD(Panasonic) don't send 0xfe(start-byte for data token) when CMD9(CSD)/CMD10(CID).
    refer: WORD"cid","csd" for sd_func_2.2
    I don't know why Panasonic's SD-CARD dosen't send 0xfe.
    Other functions are all ok.

    Please check.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-26 15:03
    caskaz wrote: »
    Your SD's 4 pull-up-resister is 10K?

    Sorry, I didn't realize I needed 10K pull-up resistors on the four Pi/o lines.
    I'll put those on and re-run my tests with 2.2
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-26 15:45
    caskaz wrote: »
    Hi prof_braino.

    I updated to sd_viewer_2.2.

    Please check.

    I found that the first file, sd_func.f would not load, possibly due to too many lines longer than 80 characters. Did you notice anything like this?
    After I shortened then, it loaded, I did the saveforth.

    Although, the second file fat.f has many lines longer than 80 characters, and loaded just file. (?) I wonder what the problem is....

    Transcend 1G still displays "no file".
    This SDSC was displayed correctly on the earlier version

    RETESTED all the versions I have:

    Version 2.0 on Propforth 3.4 was able to read and display files (U viewer option) om ALL microSD cards EXCEPT 2Gig Transcend SDSC

    Version 2.1 on Propforth 3.5 was able to initialize
    Transcend 1G viewer option L = all are 0x000
    Transcend 2G viewer option L = all are 0x000 - M,B,R,F, all give ...MSDOS5.0... in 4th byte of dump
    Sandisk 4G viewer option L = all are 0x000 - M,B,R,F, all give Sector 0x0 address 0x0

    Version 2.2 on Propforth 3.5 was able to initialize
    Transcend 1G viewer option L = all are 0x000 - M,B,R,F, all give Sector 0x0 address 0x0
    Transcend 2G viewer option L = all are 0x000 - M,B,R,F, all give ...MSDOS5.0... in 4th byte of dump
    Sandisk 4G viewer option L = all are 0x000 - - M,B,R,F, all give Sector 0x0 address 0x0; all zero's until 1C0

    I do have 10K pull-up resistors on all four P-I/O pins (18, 19, 1A, 1B in my case)
  • caskazcaskaz Posts: 957
    edited 2010-11-26 16:08
    I can load 3 files. It works fine under my protoboard.
    I use standard PropForth3.5. Not using VGA.
    free area is 0x4180.
    Pull-up-resister connected?
    Transcend 1G still displays "no file".
    What does RDE('r') display when 'u'command display "no file"?
    CSD/CID/MBR/BTB/FAT/RDE is correct?
    I found that the first file, sd_func.f would not load, possibly due to too many lines longer than 80 characters.
    What error is this?
    I don't see errors to load sd_func/fat/sd_viewer.
  • caskazcaskaz Posts: 957
    edited 2010-11-26 19:44
    Hi prof_braino.
    Transcend 1G viewer option L = all are 0x000
    This option L is "l"(SD-card Information)?
    If so, sd-card initialize is fail.

    I think sd_viewer may be fail initialize for Transcend's sd-card.
    I'm going to test to buy Transcend's sd-card .



    I'm clear my state.

    I use protoboard(no usb) and PropForth3.5 not VGA.
    There is 0x4180 in free memory in HUB Ram uderpower-on.
    SD-adapter's 4-line(clk,di,do,cs) connect 10k(pull-up-resister) to 3.3V.
    There is capacitor(10uF)between 3.3V-line and Gnd-line of SD-adapter.

    free is 0x2B1A after loading sd_func_2.2.
    free is 0x1D16 after loading sd_fat_2.2.
    free is 0x17E8 after loading sd_viewer_2.2.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-26 20:05
    caskaz wrote: »
    This option L is "l"(SD-card Information)?
    If so, sd-card initialize is fail.

    I use protoboard(no usb) and PropForth3.5 not VGA.
    There is 0x4180 in free memory in HUB Ram uderpower-on.
    SD-adapter's 4-line(clk,di,do,cs) connect 10k(pull-up-resister) to 3.3V.
    There is capacitor(10uF)between 3.3V-line and Gnd-line of SD-adapter.

    free is 0x2B1A after loading sd_func_2.2.
    free is 0x1D16 after loading sd_fat_2.2.
    free is 0x17E8 after loading sd_viewer_2.2.

    Yes, by "L" i meant lowercase "l" in the menu option.
    I'm using Propforth3.5, schmart board and protoboard, no VGA
    I do not have a capacitor, I thought the capacitors and pull up resistors were optional;
    as it worked on previous versions with no extra resistors or capacitors

    I'm now using Kingston 4Gig
    sd_init message is "SDHC initialize success"
    CSD, CID look ok (there is correct looking data)
    l option gives all 0x0

    attached is log

    Are you re-loading propforth 3.5 into EEPROM before you do your final test before posting?
    It could be that you have corrected the code ON YOU TEST RIG, but the change did no make into the code you posted?
    OR could there be PIN number hard coded in one of the functions, so it does not work with my different pin assignments?
    (I should move my SD slot to your pins to check that, I'll try that tomorrow...)
    Or I just did something wrong.
    I'll try adding the capacitor to the rig with the pull up resistors, and try moving the pins...
  • caskazcaskaz Posts: 957
    edited 2010-11-26 21:04
    Hi prof_braino.

    I checked your log.
    sd_viewer is succsessful on MBR-displaying . MBR use WORD'Block' in sd_func_2.0.
    WORD'Block' merely display sector.
    WORD'block_read' copy SD-CARD's sector to sd_buf.
    But WORD'read_block' is not working.
    So, MBR's firstSectorNumbers cannot read and other data also cannot read.
    All function not work.


    I download my uplaoded file(sd_viewer_2.2) from Parallax forum.
    It works finely under my propeller.

    I attached files not zip.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-11-27 11:26
    caskaz wrote: »
    sd_viewer is succsessful on MBR-displaying . MBR use WORD'Block' in sd_func_2.0.
    WORD'Block' merely display sector.
    WORD'block_read' copy SD-CARD's sector to sd_buf.
    But WORD'read_block' is not working.
    So, MBR's firstSectorNumbers cannot read and other data also cannot read.
    All function not work.

    I download my uplaoded file(sd_viewer_2.2) from Parallax forum.
    It works finely under my propeller.

    I attached files not zip.

    Got it!
    I'll check the not-zip files using your hardware's pin-out

    ...testing happens....

    A-HA!!!! I've discovered the error!

    I did not execute
    collect_info
    
    before running viewer!!!!

    If I might make a suggestion:

    Since viewer requires sd_init and collect_info to be executed as initialization,
    could these words be added to the definition for viewer?

    example:
    : viewer       \ main
                sd_init
                collect_info
    card_alive?
    ....
    ....
    
Sign In or Register to comment.