Shop OBEX P1 Docs P2 Docs Learn Events
Quick Start Touch Demo plus Forth — Parallax Forums

Quick Start Touch Demo plus Forth

prof_brainoprof_braino Posts: 4,313
edited 2011-07-30 16:21 in Propeller 1
caskaz ported the touch sense demo to propforth.

This version adds running the demo at power up, and keeps the forth prompt running on the serial connection.


Needs propforthkerenl.spin loaded via proptool,
and the demo loaded via serial terminal.

Comments

  • caskazcaskaz Posts: 957
    edited 2011-06-29 08:09
    Hi.
    I did experiments about RC-decay.
    Sense-status of TouchSense on board is displayed on LCD.

    QuickStart 2-wire_LCD I/F
    P8 J1-9 ---- CN1-3 latch
    P9 J1-8 ---- CN1-4 clock
    P10 J1-11 ---- CN1-6 brightness
    J1-38 ---- CN1-1 3.3V
    J1-39 ---- CN1-2 Gnd

    Loading 2_wire_LCD_1.4_QS.f.
    Loading TouchSense_graph.f.
    (There are a couple of 0x0 on statck. This is PF4.5's bug. This is fixed on next version.)

    Executing WORD"graph".
  • caskazcaskaz Posts: 957
    edited 2011-07-10 07:30
    Hi.
    I made DS1337 driver(rtc).
    No function yet. Only read/write registers inside DS1337.
    1024 x 768 - 168K
    1024 x 726 - 73K
  • caskazcaskaz Posts: 957
    edited 2011-07-11 08:15
    Hi.
    I translated DEMO: QuickStart - Push-ON / Push-OFF to PropForth.
    http://forums.parallax.com/showthread.php?132795-DEMO-QuickStart-Push-ON-Push-OFF
    I used Ariba's code(#19).
    Thanks Ariba.

    But not stable.
    How do you modify codes to work?
    fl
    
    hex
    
    0 wconstant _pad
    10 wconstant _LEDs
    
    : demo1
    dira COG@ ff _LEDs lshift or dira COG!       \ set LEDs to output
    outa COG@ ff _pad lshift or outa COG!        \ set _pad's outa to high
    ff
    begin
         dira COG@ ff or dira COG!               \ set _pad to output
         dira COG@ ff invert and dira COG!       \ set _pad to input
         8 delms                                 \ wait                           
         ina COG@ ff and ff xor dup rot          \ xor _pad's value and 0xff    if touch, its pad is high
         = if drop ff                            \ when current is same as previous, drop
           else dup 10 lshift                    \ shift value to LEDs bit
                outa COG@ xor                    \ xor value and outa
                00ff0000 and outa COG@ ff00ffff and or  outa COG!    
           then
         8 delms     
    0 until
    ;
    
    
    
    decimal
    
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-07-11 08:39
    caskaz wrote: »
    I used Ariba's code(#19). How do you modify codes to work?

    Post 24 he tests on the other 50/60hz half-wave, this looks like the solution.
  • caskazcaskaz Posts: 957
    edited 2011-07-12 00:32
    Hi.
    I tested 24LC1025(128k x 8bit) on QuickStart(64k).
    fs.f don't use on 24LC1025.
    Chip-select on 24LC1025 use only A0/A1. Bank-Select-Bit switch 64k.
    I modified to fs_128k.f.
    I modified only fsbot,fstop.fsps,eereadpage.
    Only "fsls" can use on fs_128k.f.
    Prop0 Cog6 ok
    fsls
    
    131072 bytes free in EEPROM file system
    Prop0 Cog6 ok
    
    I stopped to modify codes.

    In case of using 24LC1025, we can't use 0x8000 - 1ffff, although QS has 64k.
    24LC1025 is expensive than 24C512. (more than 2times)
    And 24LC1025 and 24C512 can't use same driver.
    I think there is not merit to use 24LC1025.
    How do you think?
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-07-12 07:33
    caskaz wrote: »
    I tested 24LC1025(128k x 8bit) on QuickStart(64k).fs.f don't use on 24LC1025.
    Chip-select on 24LC1025 use only A0/A1. Bank-Select-Bit switch 64k.
    In case of using 24LC1025, we can't use 0x8000 - 1ffff, although QS has 64k.
    24LC1025 is expensive than 24C512. (more than 2times)
    And 24LC1025 and 24C512 can't use same driver.
    I think there is not merit to use 24LC1025.

    Could this be related to whatwe saw in issue 25? http://code.google.com/p/propforth/issues/detail?id=25
    We thought the issue was solved (a hardware problem) but seems to have returned.
    I don't have any extra EEPROMs, I can only test 32k and 64k.
    Sal could not reproduce the symptom either, which is why we thought it was unique to Brian's hardware.

    If you already have the 24LC1025, then I would think a separate fsls-24LC1025.f file would be the way to go. The price usually drops eventually, and some folks may decide they need 1 of 128k instead of 2 of 64k.

    Just thinking wihthout experimenting, does it look like we need multiples of the chip size so they address properly?
    That is, Demoboard + 24LC1025 (32K +128k) has issue;
    But Demoboard + 24C256 + 24C512 + 24LC1025 (32k + 32k + 64k + 128K) is OK ?

    Next time I buy parts I should get EEPROMs, but this is not in my (wife's) budget at this time.
  • caskazcaskaz Posts: 957
    edited 2011-07-12 15:31
    Hi prof_braino.
    I think issue25 isn't related.
    128k and 64k(32k) is different to access to chip.
    64k(32k) send A0/A1/A2 on I2C. (total 8pcs)
    128k(32k) send A0/A1/B0 on I2C.(total 4pcs)

    Accessing 0x20000 for 128k send A0=1 A1=0 B0=0 and 0x30000 for 128k send A0=1 A1=0 B0=1.
    Accessing 0x10000 for 64k send A0=1 A1=0 A2=0 and 0x20000 for 64k send A0=0 A1=1 A2=0.
    Connecting 128k and 64k to same line might be conflict.

    Using only 128k to external is no problem.
    You need to modify fs.f to be able to use on 128k.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-07-12 19:48
    Thanks, I'll play with this next time I buy parts.
  • caskazcaskaz Posts: 957
    edited 2011-07-13 19:39
    Hi.

    I did experiments about LED-sensor.
    P12 --- 220ohm -- LED anode - LED cathode
    P13

    Executing WORD"LED" when bright around LED.
    LED blink after 2seconds.
    And then when it's dark above LED, LED is blinking. When It's bright, LED is off.

    But this don't work on every LED.
    I checked 5pcs.
    3pcs LED was NG.

    I measured voltages between LED-anode and cathode under same condition(same light intensy, same distance) when there is light on LED surface.
    They(NG LED) was low voltage than working fine LEDs.

    And executed WORD"test", you can check values(bright and dark).
    LEDs(OK) is 1000000(decimal) under bright and 250000 - 400000 under dark.
    LEDs(NG) is too big or unstable under bright and dark.

    To prof_braino.
    I don't use translate program.
  • caskazcaskaz Posts: 957
    edited 2011-07-14 07:45
    Hi.
    I wrote rotary-encoder driver.
  • caskazcaskaz Posts: 957
    edited 2011-07-14 16:33
  • caskazcaskaz Posts: 957
    edited 2011-07-15 21:02
    Hi.
    I updated.
    This occur count-miss because forth-word.
    test1 sometimes occur miss when rapidly rotating encoder.
    test2 can't count because often miss.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-07-16 08:33
    I added link to caskaz' recent work (above) to the extensions page.

    http://code.google.com/p/propforth/wiki/PropForthExtensions

    When 5.0 is out, I plan to use the extensions page as checklist and gather up all the extensions.

    When an exension has a working regression test that runs under the automated regression suite, I will (try to) add it to the achive for the recent release.
  • caskazcaskaz Posts: 957
    edited 2011-07-23 07:11
    Hi.
    I made SteppingMotor driver.
    Motor is bipolar type(TS3166N913).

    Loading encoder_0.3.f
    Loading SteppingMotor_0.1.f

    WORD"full" = full-step
    WORD"half" = half-step
    RPM(Revolution per minute) of motor is changed by rotating rotary-encoder.

    To do next:
    Getting actual revolution by using sensor of stepping-motor
    Operating micro-step
    Connecting LCD

    PS:
    This curcuit occure damages in TA7291P when continuing rotation.
    Output of TA7291P need to connect power-Tr or MOS-FET.
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-07-23 10:17
    Caskaz, you are too fast. I'm still looking for parts on the LCD driver circuit!

    Very good work.
  • caskazcaskaz Posts: 957
    edited 2011-07-28 23:18
    Hi.
    I updated SteppingMotor because SteppingMotor_0.1 was incorrect inside "half".
    TA7291P become very hot when rapidly rotatation.
    So I will change drive-IC(output-current: more than 3A) or build H-bridge-curcuit.
  • caskazcaskaz Posts: 957
    edited 2011-07-30 00:48
    Hi.
    I translated BigFont of Aruduino to PropForth4.6.
    (prompt messages is PropForth v4.5 2011JUL25 7:10 0.)
    LCD is 16Character 4Line.

    I found out strange.
    I stored font-data in hub-memory by using "c,".
    Display is strange from ascii-code 0x5f.
    It seems that Datas is not correctly stored from 372th byte.

    Loading 2_wire_LCD_1.5 and BigFont.
    Executing "demo".
    hex
    
    demo
    ..
    ..
    
    5D ;20 1 FF 20 2 FF     
    
    5E ;20 2 20 1 20 1
    
    5F ;20 20 20 2 2 20      <---- forth code is '20 c, 20 c, 20 c, 02 c, 02 c, 02 c'
    
    60 ;1 5 20 20 5 5        <---- forth code is '20 c, 01 c, 05 c, 20 c, 20 c, 20 c
    ..
    
    Prop0 Cog6 ok
    
    1024 x 768 - 203K
    1024 x 768 - 242K
  • kuronekokuroneko Posts: 3,623
    edited 2011-07-30 01:01
    Isn't that simply a typo (c instead of c,)?
    20 c, 20 c, 20 c, 02 c, 02 c, 02 c[COLOR="red"],[/COLOR]            \ ascii code 0x5f
    20 c, 01 c, 05 c, 20 c, 20 c, 20 c[COLOR="red"],[/COLOR]
    
  • caskazcaskaz Posts: 957
    edited 2011-07-30 01:07
    Thanks kuroneko-san.

    It's my mistake.
    I also found out another wrong.

    I will post correct code later.
  • caskazcaskaz Posts: 957
    edited 2011-07-30 16:21
    Hi.
    I updated Bigfont.
Sign In or Register to comment.