Shop OBEX P1 Docs P2 Docs Learn Events
Propforth v5.5 is available for download - Page 25 — Parallax Forums

Propforth v5.5 is available for download

12021222325

Comments

  • caskazcaskaz Posts: 957
    edited 2018-06-17 07:25
    Rebuild 6legs-robot(FOLO) to Line-trace-robot.


    There is original movie of FOLO in HP.
    https://www.elekit.co.jp/product/MR-9107
  • Rewrote code of NeoPixelRing.

  • Rewrote code of inifinityLED.
    Actually almost same code as NeoPixelRing.

  • I wrote IR decoder.
    Prop0 Cog6 ok
    irAnalyze
    NEC format
    Received data:B847FF00
    CustomCode:FF00
    Data:47
    
    NEC format
    RepeatCode
    
    NEC format
    Received data:F807FF00
    CustomCode:FF00
    Data:07
    
    NEC format
    RepeatCode
    
    NEC format
    Received data:E51A4086
    CustomCode:4086
    Data:1A
    
    NEC format
    Received data:E31C4086
    CustomCode:4086
    Data:1C
    
    AEHA format
    Received data:48 bit  F012_00CF5AAA_00000000_0000
    CustomrCode:h5AAA
    Parity:hF
    Data:hF01200C
    
    AEHA format
    Received data:48 bit  E013_00CF5AAA_00000000_0000
    CustomrCode:h5AAA
    Parity:hF
    Data:hE01300C
    
    AEHA format
    Received data:48 bit  D010_00CF5AAA_00000000_0000
    CustomrCode:h5AAA
    Parity:hF
    Data:hD01000C
    
    AEHA format
    Received data:48 bit  C011_00CF5AAA_00000000_0000
    CustomrCode:h5AAA
    Parity:hF
    Data:hC01100C
    
    SONY format
    Received data:12 bit 11A0_0000
    Address:7bit 08
    Data:5 bit  h001A
    
    SONY format
    Received data:12 bit 11A0_0000
    Address:7bit 08
    Data:5 bit  h001A
    
    SONY format
    Received data:12 bit 1180_0000
    Address:7bit 08
    Data:5 bit  h0018
    
    SONY format
    Received data:12 bit 1180_0000
    Address:7bit 08
    Data:5 bit  h0018
    
    SONY format
    Received data:15 bit B454_0000
    Address:7bit 5A
    Data:8 bit  h002A
    
    SONY format
    Received data:15 bit B454_0000
    Address:7bit 5A
    Data:8 bit  h002A
    
    SONY format
    Received data:15 bit B456_0000
    Address:7bit 5A
    Data:8 bit  h002B
    
    SONY format
    Received data:15 bit B456_0000
    Address:7bit 5A
    Data:8 bit  h002B
    
  • Controlled FOLO by IR-remocon.

  • Updated to FOLO_0.2.
    FOLO_0.1 had bug cause stack-overflow on cog1.
    And IR-remocon changed.
    Changed code to turn R-key(L-key) to right(left) on back-walking.
    1024 x 1024 - 58K
  • Thanks for all your entries to this thread that seems to have become very quiet, except for your exceptional entries.
  • caskazcaskaz Posts: 957
    edited 2018-09-18 11:58
    monochrome-printing.

    Processing2
    Loading bmp-file(768x1024pixels)
    Converted grayscale-file(384x512pixels)
    Calculeted Error diffusion method
    Packed 1byte/8pixels
    Transmitted data(1st:12000byte, 2nd:12576byte) to PropForth

    PropForth5.5
    Received data(1st:12000byte)
    Transmitted data to ThermalPrinter(width:384dots=48byte)
    Requested next data
    Received data(2nd:12576byte)
    Transmitted data to ThermalPrinter


  • Modified monochroPrint.
    A little bit fast.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-19 02:26
    Nice!

    I remember in the very early 90's interfacing to an Apple Imagewriter printer ..... in reverse! In fact the printer wasn't connected but the Mac would print a tenant directory and I would extract the graphics I needed to send over networked RS-485 to kilometers of fireproof cable snaking up and down to high and low rise lifts in an office building to dual graphic display panels arranged vertically as one tall graphic display. This was all programmed in Forth and I think it only used a 65C02 with a version of my Forth. At other times I have written to various thermal printers as well.

    I looked at how your code could run in Tachyon, a bit like this:
    \ Send command to ThermalPrinter
    \ ( nn-nm n1 -- )   nn-nm:data if needed  n1:command 
    \ uses: wvariable ESC_2 -2 allot 2 c, 0 c, h1B c, h32 c,
    \ Tachyon table method ....
    \               cnt  ext  string
    \ TABLE ESC_2     2 | 0 | $1B | $32 |
    : prtcmd
    ---        cnt    ptr                     0/1 n1
            DUP C@ OVER 2+ FROM                     \ index from 3rd element
            FOR I C@ Transmit NEXT                  \ Serial out command
            1+ C@ ?DUP IF FOR Transmit NEXT THEN    \ Serial out data
    ;
    
    I like to try coding an equivalent program in Tachyon from whatever language I see interesting code, just so I can identify strengths and weaknesses and continue to improve Tachyon. If I send you some code would you like to try it out? I could package it all as a binary if you prefer.

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-19 12:38
    Seems that there isn't much actual code that needs to run and it turns out to be very simple in Tachyon. I did keep the unused printer commands but converted them to a simpler form. Maybe this will run on your system although it probably needs a reduced EXTEND to free up 12K although I could easily use EEPROM or an SD file for buffering. (EDIT: EXTEND has been rearranged so that now if you FORGET TOOLS you will have more than enough room)

    I loaded this in and it took 164 code bytes.
    TACHYON V5
    
    ( serial for  ThermalPrinter )
    9       := RXDPRT
    10      := TXDPRT
    
    ( PC DATA )
    26      := TXD232
    27      := RXD232
    
    : RS232			115200 SERBAUD KEY: RXD232 SERIN ;
    : PRINTER		9600 SERBAUD TXDPRT HIGH EMIT: TXDPRT SEROUT ;
    
    : ESC ( n -- )		$1B EMIT EMIT ;
    
    {  ------------ OPTIONAL CODES (not used) ------------
    
    	: code437               't' ESC 0 EMIT ;
    	: code850               't' ESC 1 EMIT ;
    	: ATR ( on/off n -- )	ESC 1 AND EMIT ;
    	\ Set bold font ( on/off -- )
    	: BOLD			$20 ATR ;
    	\ Set double-width ( on/off -- )
    	: DOUBLE		IF $0E ELSE $14 THEN ESC ;
    	\ Set character updown ( on/off -- )
    	: UPDOWN		$7B ATR ;
    	\ Set reverse mode  ( -- )
    	: REVERSE		$1D EMIT 'B' EMIT 1 AND EMIT ;
    	\ Set font size  ( n -- ) n:font size  7<n<24
    	: FONT			$1D EMIT '!' EMIT EMIT ;
    	\ Set start-position to left
    	: LEFT                  0 'a' ATR ;
    	\ Set start-position to center
    	: CENTER                1 'a' ATR ;
    	\ Set start-position to right
    	: RIGHT                 2 'a' ATR;
    	\ TAB (6 blank char)
    	: TABULATE              5 'B' ATR ;
    	\ --- ESC ! ---
    	\ Set small character
    	: SMALL			1
    	: CHAR			'!' ATR ;
    	\ Set emphasized mode
    	: EMPHASIZE	        8 CHAR ;
    	\ Set Double height mode
    	: TALL			$10 CHAR ;
    	\ Set	Double width mode
    	: WIDE		       $20 CHAR ;
    	\ Set underline
    	: UNDERLINE	       $80 CHAR ;
    	\ Cancel ESC !
    	: PLAIN	               0 CHAR ;
    }
    
    \ Receive print-data from PC
    : RxData        RS232 HERE FROM 12288 FOR RXD232 SERIN I C! NEXT ;
    
    \ Print bitmap
    : dotPrint
            PRINTER HERE
            2 FOR
    	$12 EMIT $2A EMIT 128 EMIT 48 EMIT 10 ms
              128 FOR
                48 FOR DUP C@ $FF XOR EMIT 1+ NEXT
              NEXT
            NEXT
            DROP
    ;
    
    \ Receive bit-data to print(24576byte:384x512dots)
    : monochroPrint
            PRINTER '@' ESC				\ INIT PRINTER
    	$37 ESC 5 EMIT 100 EMIT 40 EMIT		\ n1(max heating dots)=5 n2(Heating Time)=50 n3(Heatin Interval)=40
            $12 EMIT $23 EMIT $FF EMIT              \ Change density
    	RxData  dotPrint			\ Receive 1st print-data
            60 TXD232 SEROUT			\ Request next print-data
            RxData dotPrint				\ Receive 2nd print-data
    	CON					\ return to console
    ;
    END
    {
    Code bytes used = 164
    Name bytes used = 102
    }
    


  • I tried to speed up ThermalPrinter.
    Downloaded tool from Adafruit.
    https://learn.adafruit.com/mini-thermal-receipt-printer/downloads

    There is 'AclasTool.exe' inside update_firmware.zip.

    Change from 9600 to 115200 is successfull.
    But dotprint is NG because print-speed still is slow.
    It seems to need flow-control.
    4320 x 3240 - 1M
    4320 x 3240 - 1M
  • kwinnkwinn Posts: 8,697
    edited 2018-09-20 02:15
    caskaz wrote: »
    I tried to speed up ThermalPrinter.
    Downloaded tool from Adafruit.
    https://learn.adafruit.com/mini-thermal-receipt-printer/downloads

    There is 'AclasTool.exe' inside update_firmware.zip.

    Change from 9600 to 115200 is successfull.
    But dotprint is NG because print-speed still is slow.
    It seems to need flow-control.

    Limited speed to be expected due to the mechanical systems. Print head heating elements need time to heat up and cool down before the print head moves, and carriage/print head movements take some time, so not much if anything is gained by higher baud rates.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-09-20 02:54
    Yes, thermal printers can have one wide stationary head and print very fast or they can have a scanning head which is cheaper but slows things down a lot.

    From the Adafruit manual:
    Some printers arrive from the factory set for 19200 baud, but a few may be set to 9600. This will not negatively impact
    the performance of your unit! The speed of the paper through the printer is already much less than this and you will
    not see any difference...it's strictly a data protocol issue of getting the microcontroller and printer communicating.
  • Speedup is successfull to add RTS signal.


    4320 x 3240 - 1M
  • Printed out lena.

    lena is successfull.
    But lena-full is bad.
    Image of legs-part is strange.
    First half image(1st:12288byte 2nd:12288byte) are ok.
    Latter halfimage(3rd:12288byte 4th:2496byte) are bad.
    I have no idea although it seems sending data from Processing2 are strange.
    4320 x 3240 - 2M
    4320 x 2880 - 2M
  • The problem is that you are dealing with "raw" data :)
  • Modified lenafull_0.2.f.

    RTS is Lo when printer is busy.
    But it seems too late.
    : Ready? 1 delms begin RTSm ina COG@ and 0= until ;
    
    In case of dog.bmp, delay must be more than 1delms because of many dark-dots.
    4320 x 3240 - 2M
  • I modofied word"updateAge" in DogLifeClock.
    She is 15 years old.
  • Here is DogLifeClock.
    720 x 960 - 121K
  • Tried making "Levitating WaterDrop".
    But not clear waterdrop yet.

  • cool
  • caskazcaskaz Posts: 957
    edited 2019-12-10 06:29
    Writed code for W25Q64FV(8MB:NOR type Flash ROM).
    Prop0 Cog6 ok
    spiInit
    Prop0 Cog6 ok
    getJEDEC
    Capasity: 17
    Memory Type: 40
    Manufacture ID: EF
    
    Prop0 Cog6 ok
    getUniqueID
    Serial number: D164_0C12 4F32_4337
    
    
    Prop0 Cog6 ok
    releasePowerID
    DeviceID: 16
    
    Prop0 Cog6 ok
    manufactureID
    DeviceID: 16
    Manufacture ID: EF
    
    Prop0 Cog6 ok
    hex
    Prop0 Cog6 ok
    0 1 test               <-- Write 256byte[1,2,3,..] in sector0
    
    4660 0100:
    4660: 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10   ................
    4670: 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20   ...............
    4680: 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30   !"#$%&'()*+,-./0
    4690: 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40   123456789:;<=>?@
    46A0: 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50   ABCDEFGHIJKLMNOP
    46B0: 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60   QRSTUVWXYZ[\]^_`
    46C0: 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70   abcdefghijklmnop
    46D0: 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80   qrstuvwxyz{|}~..
    46E0: 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90   ................
    46F0: 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0   ................
    4700: A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0   ................
    4710: B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0   ................
    4720: C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0   ................
    4730: D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0   ................
    4740: E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0   ................
    4750: F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 00   ................
    Prop0 Cog6 ok
    0 eraseSector        <-- Erase data in sector0
    Prop0 Cog6 ok
    0 2 test             <-- Write 256byte[2,3,4,..] in sector0
    
    4660 0100:
    4660: 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11   ................
    4670: 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21   .............. !
    4680: 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31   "#$%&'()*+,-./01
    4690: 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41   23456789:;<=>?@A
    46A0: 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51   BCDEFGHIJKLMNOPQ
    46B0: 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61   RSTUVWXYZ[\]^_`a
    46C0: 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71   bcdefghijklmnopq
    46D0: 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81   rstuvwxyz{|}~...
    46E0: 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91   ................
    46F0: 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1   ................
    4700: A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1   ................
    4710: B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1   ................
    4720: C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1   ................
    4730: D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1   ................
    4740: E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1   ................
    4750: F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 00 01   ................
    Prop0 Cog6 ok
    
    d4096 3 test            <-- Write 256byte[3,4,5,..] in sector1
    
    4660 0100:
    4660: 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12   ................
    4670: 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22   ............. !"
    4680: 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32   #$%&'()*+,-./012
    4690: 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42   3456789:;<=>?@AB
    46A0: 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52   CDEFGHIJKLMNOPQR
    46B0: 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62   STUVWXYZ[\]^_`ab
    46C0: 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72   cdefghijklmnopqr
    46D0: 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82   stuvwxyz{|}~....
    46E0: 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92   ................
    46F0: 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2   ................
    4700: A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2   ................
    4710: B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2   ................
    4720: C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2   ................
    4730: D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2   ................
    4740: E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2   ................
    4750: F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 00 01 02   ................
    Prop0 Cog6 ok
    1  eraseSector         <-- Erase data in sector1
    Prop0 Cog6 ok          Writed code for W25Q64FV(NOR type Flash ROM).
    
    d4096 4 test           <-- Write 256byte[4,5,6,..] in sector1
    
    4660 0100:
    4660: 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13   ................
    4670: 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23   ............ !"#
    4680: 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33   $%&'()*+,-./0123
    4690: 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43   456789:;<=>?@ABC
    46A0: 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53   DEFGHIJKLMNOPQRS
    46B0: 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63   TUVWXYZ[\]^_`abc
    46C0: 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73   defghijklmnopqrs
    46D0: 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F 80 81 82 83   tuvwxyz{|}~.....
    46E0: 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90 91 92 93   ................
    46F0: 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F A0 A1 A2 A3   ................
    4700: A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF B0 B1 B2 B3   ................
    4710: B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF C0 C1 C2 C3   ................
    4720: C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF D0 D1 D2 D3   ................
    4730: D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF E0 E1 E2 E3   ................
    4740: E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF F0 F1 F2 F3   ................
    4750: F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF 00 01 02 03   ................
    Prop0 Cog6 ok
    
    
  • Code(i2c) for ToF-module(MTOF171000C0).
    Prop0 Cog6 ok
    std_i2c_detect
         0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
    00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    i2c_device:2
    
    
    Prop0 Cog6 ok
    demo
    128 mm
    128 mm
    128 mm
    126 mm
    126 mm
    126 mm
    128 mm
    126 mm
    128 mm
    125 mm
    124 mm
    124 mm
    127 mm
    127 mm
    123 mm
    123 mm
    124 mm
    124 mm
    120 mm
    118 mm
    118 mm
    118 mm
    115 mm
    108 mm
    108 mm
    107 mm
    106 mm
    101 mm
    103 mm
    103 mm
    103 mm
    103 mm
    104 mm
    104 mm
    102 mm
    102 mm
    103 mm
    105 mm
    107 mm
    105 mm
    104 mm
    103 mm
    104 mm
    104 mm
    104 mm
    106 mm
    107 mm
    114 mm
    114 mm
    112 mm
    109 mm
    105 mm
    Prop0 Cog6 ok
    

    Serial connection to ToF does not work yet.
    No reply to send commnds.

    She is 16years old.
    2816 x 2112 - 769K
  • Display sensors on LED matrix.

    rtc PCF85263
    Temperature/Humidity SHT31
    Pressure LPS25H
    Adafruit 32x64 LED matrix

  • I put EnviromentSensors in the box.
    Used ToF-module(MTOF171000C0) as distance sensor.
    This ToF use only I2C. Not used serial.


  • Glad you are hanging in there after all these years! :)
  • caskazcaskaz Posts: 957
    edited 2020-04-27 13:28
    Operated Rover by IR-controller(NEC format).
    2816 x 2112 - 1M
  • caskazcaskaz Posts: 957
    edited 2020-12-14 01:56
    I wrote Forth-code for RoverC-Pro.
    I know using M56StickC is smart.
    Prop0 Cog6 ok
    std_i2c_detect
         0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
    00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    i2c_device:2
    
    
    Prop0 Cog6 ok
    

    My dog was dead on Dec 10 00:15.
    Livingdays was 6189.
    I buried her by the orenge tree in my house.
    1536 x 2048 - 454K
    1536 x 2048 - 344K
    640 x 480 - 227K
Sign In or Register to comment.