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
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.
PropForth5.5
Received data(1st:12000byte)
Transmitted data to ThermalPrinter(width:384dots=48byte)
Requested next data
Received data(2nd:12576byte)
Transmitted data to ThermalPrinter
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.
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
}
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.
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.
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.
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.
Comments
There is original movie of FOLO in HP.
https://www.elekit.co.jp/product/MR-9107
Actually almost same code as NeoPixelRing.
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.
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
A little bit fast.
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: 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.
I loaded this in and it took 164 code bytes.
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.
From the Adafruit manual:
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.
RTS is Lo when printer is busy.
But it seems too late. In case of dog.bmp, delay must be more than 1delms because of many dark-dots.
She is 15 years old.
But not clear waterdrop yet.
Serial connection to ToF does not work yet.
No reply to send commnds.
She is 16years old.
rtc PCF85263
Temperature/Humidity SHT31
Pressure LPS25H
Adafruit 32x64 LED matrix
Used ToF-module(MTOF171000C0) as distance sensor.
This ToF use only I2C. Not used serial.
I know using M56StickC is smart.
My dog was dead on Dec 10 00:15.
Livingdays was 6189.
I buried her by the orenge tree in my house.