HI.
I'm making 2_wire_LCD.
But not operating correctly.
After power on character-LCD, word'demo2' always firstly not operate correctly. (cimg3558.jpg)
But word'demo2' operate perfectly at second time.(cimg3559.jpg)
After power on character-LCD, word'demo1' never operate .
But after operated word'demo2', word'demo1' operate perfectly.
If curcuit is wrong, it should be NOT operate at all.
I think there are mistakes in forth-code or assembler-code.
But I have no idea.
Do you have any idea?
Hi.
i2c_charLCD and i2c_charLCD_II are codes for 1pc characterLCD.
CHaracterLCD can connect max 8pcs on SDA/SCL, because PCF8574 and MCP23017 have 3 address lines.
Of course, modification need.
Expected frequency(500k,1M,2M,4M) don't put out.
In case of 500kHz, pulse-width at Hi and Lo is different.
More than 10000kHz cannot observe by osciloscope.
Where does code wrong?
I modified a little.
DotCorrection data can read By StatusInformationOutput(SIO).
Removed wire connected to OUT3.
LED conncted to XERR is on.
But data(LOD) from SIO cannot read it.
Do you have any idea?
Prop0 Cog6 ok
demo2
20_724 00_016:
20_724: 000 004 008 012 016 020 024 028 032 036 040 044 048 052 056 060 ........ $(,048< <-- Data to write in DC-register
LOD:h0
TEF:h0
20_724 00_016:
20_724: 000 004 008 012 016 020 024 028 032 036 040 044 048 052 056 060 ........ $(,048< <-- Reading data from DC-register by SIO
Prop0 Cog6 ok
CON:Prop0 Cog0 RESET - last status: 0 ok
There is statement in page18 of TLC5940.pdf below;
"The first GS data input cycle after dot correction requires an additional SCLK pulse after the XLAT signal to
complete the grayscale update cycle. All GS data in the input shift register is replaced with status information
data (SID) after updated the grayscale register."
It seems to need need 'SCLK pulse' if SIO need to get.
But it seems to to need update dot-correction register only 1 time.
I think it don't need to be care because strange is only first 1-time.
'Init_TLC5940' set d63 to Dot-Correction registers and 0 to Gray-Scale registers.
Not 'SCLK pulse'.
Photo of demo1 is cimg3583.
This change only gray-scale registers.
Photo of demo2 and demo3 is cimg3585.
This change only dot-correction registers.
Gra-scale registers are all d200.
demo3 use another code(using 'SCLK pulse') instead of 'init_TLC5940'.
I think Reading of Dot-correction registers is correct.
But reading of LOD is incorrect.
Photo of demo4 is cimg3586.
Front of demo4 don't use 'dc_update'.
It seems to be still d63 only dot-correction register of OUT15(right side LED of cimg3586).
In case of rear of demo4, all LEDs are same brightness.
I don't understand why only OUT15.
I cannot compare other chip because I have only 1pc TLC5940.
Sorry, I misunderstood about 1 SCLK-pulse.
I misunderstood SIO need 1 SCLK-pulse.
I understood dot-correction register need it.
When dot-correction register change, needing SCLK-pulse only first 1-time afterXLAT pulse.
Sorry, I misunderstood about 1 SCLK-pulse.
I misunderstood SIO need 1 SCLK-pulse.
I understood dot-correction register need it.
When dot-correction register change, needing SCLK-pulse only first 1-time afterXLAT pulse.
So did you get it worked out?
I'm about to start the call, but I don't have the part and driver is a little bit involved, I don't fully understand the situation.
Is the a question we should ask of Sal?
Problems were below;
1. When dot-corrections are changed, only OUT15's dot-correction don't change.
SCLK-pulse after XLAT solved this. ( I misunderstood reading from manual)
2.When getted SIO, LOD(16bit) is always '0'.
SIO(StatusInformationOutput)
b0 - b15 LOD(LED OPEN DETECTION) data
b16: TEF(THERMAL ERROR FLAG)
b17 - b23: unknown
b24 - b119: Dot Correction value
b120 - b191: Reserved
I think Dot Correction value can get from SIO.
But, maybe there are bugs in code because LOD cannot get.
Updated TLC5940 code.
Some LEDs is on because registers(GrayScale, DotCorrection) is unknown at power-on.
To prevent this, I think needing pulled up BLANK-pin.
Code need to modify.
Prop0 Cog6 ok
demo2
17_780 00_016:
17_780: 000 004 008 012 016 020 024 028 032 036 040 044 048 052 056 060 ........ $(,048< <-- data to write in DotCorrection registers
h4000 <--- LOD(OUT14 is open)
h0 <--- TEF(When bit7=1, thermalerror)
0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 <-- Reading data from DotCorrection registers
Prop0 Cog6 ok
Removed VFD from junk DVD-player.
VFD model is FHD81X18-0635.
MOSFET(2N7002) is used as level-shifter.
Displayed string'Forth' on VFD.
VFD-controller is PT6312.
I'm trying to display Adafruit matrix.
'demo' write values on d-buf and display them on d-buf.
'matrix_scan' display them on d-buf.
Photo is cimg3628.jpg.
[/] are drawed on surface on panel.
But 'c" matrix_scan" 0 cogx' indicate different result.
There are lines on 8th line of upper and lower.
Photo is cimg3629.jpg.
Sorry, it was my mistake.
outa register on cog6 was h1C0 by 'demo'.
I forgot to clear outa register on cog6.
So, [C B A]value is always [1 1 1] although outa register on cog0 change.
8x8-font are displayd on upper section of Adafrui matrix16x32.
This is only 7colors.
Character data(including [A B C]line and [R1 G1 B1] and EN) are placed inside matrix_array(2048bytes).
'test2' continue to scan matrix_array(2048bytes).
But dot with [0 0 0] of [R1 G1 B1] is a little on.
Maybe I think this is ghost.
\ Scan matrix_array to display
\ ( -- )
: test2
hFFF dira COG!
matrix_array
begin
dup
d16 0 do
d32 0 do
a_matrix_16x32_2
loop
LE pinhi LE pinlo
EN pinlo
loop
drop
fkey? swap drop
until
drop
;
{
fl
\ ( n1 -- n2 ) n1:address of buffer
build_BootOpt :rasm
rdlong outa , $C_stTOS
or outa , __clk
add $C_stTOS , # 4
jexit
__clk
h200
;asm a_matrix_16x32_2
}
Adafruit_matrix_0.2_2 is not normal code.
Not defined 2048bytes about array by code.
Before loading;
reboot
..
Prop0 Cog6 ok
variable matrix_array
matrix_array .
17616 Prop0 Cog6 ok <-- if dev-kerenel, it should be 17616.
19663 here W! <-- 'here' changed
Loaing Adafruit_matrix_0.2_2
Messages in TeraTerm should stop during loading code.
After hitting return-key, loading restart and finish.
Execute 'demo'
Before loading Adafruit_matrix_0.3, execute below;
reboot
..
Prop0 Cog6 ok
variable matrix_array
Prop0 Cog6 ok
matrix_array .
17616 Prop0 Cog6 ok <-- If Dev-kernel, it should be 17616.
d17616 d1024 + here W!
Prop0 Cog6 ok
If messages stop in TeraTerm window, it finish by hitting return-key.
Printed string"May the Forth be with you. " with green(2) on upper section(0) of Adafruit matrix16x32.
c" May the Forth be with you. " 2 0 adafruit_str
Printed string"May the Forth be with you. " with green(2) on upper section(0) of Adafruit matrix16x32.
c" May the Forth be with you. " 2 0 adafruit_str
Would you please include the forth code for the optimize instruction
a_matrix_16x32_2
as a comment if a version 0.5 is posted?
Is wvariable n an extra loop counter for the third outter loop? I always cringe when I see single character variable names.
I respect i and j for loop counters, those being the names used since the days when names were limited to 3 characters.
But all other names should have some clue at to what they are used for.
Other than than, very nice code, and very cool demo!
Could you maybe creat a wiki page? This is too cool to let it get lost.
n of 'prepare_array'is outer loop counter.
This indicate upper matric(8x32) or lower matrix(8x32).
\ Set each Long data of matrix_array to outa
\ ( n1 -- n2 ) n1:address of matrix_array n2:n1+2 <--- correct
lockdict create a_matrix_16x32_2 forthentry
$C_a_lxasm w, h118 h113 1- tuck - h9 lshift or here W@ alignl h10 lshift or l,
z4ixZB l, z1bix[N l, z20yPO2 l, z1SV01X l, z80 l,
freedict
{
fl
\ ( n1 -- n2 ) n1:address of buffer
build_BootOpt :rasm
rdword outa , $C_stTOS
or outa , __clk
add $C_stTOS , # 2
jexit
__clk
h200
;asm a_matrix_16x32_2
}
I'm writing code for printing ROM-chip font(16x16[JIS0208], 8x16[ASCII]).
Code for character finish next.
After it, I want to display full color picture.
I finded out Rayman's thread"Propellering the Adafruit 16x32xRGB LED array".
Maybe I think it cannot translate directly because this use "long OutputArray[32*8*8]"(8192bytes) on Adafruit mateix(16x32).
I cannot understand it yet.
Comments
I'm making 2_wire_LCD.
But not operating correctly.
After power on character-LCD, word'demo2' always firstly not operate correctly. (cimg3558.jpg)
But word'demo2' operate perfectly at second time.(cimg3559.jpg)
After power on character-LCD, word'demo1' never operate .
But after operated word'demo2', word'demo1' operate perfectly.
If curcuit is wrong, it should be NOT operate at all.
I think there are mistakes in forth-code or assembler-code.
But I have no idea.
Do you have any idea?
There were mistakes on procedure inside word'lcd_init' and delay time on another word.
Added MCP23017.
Updated i2c_utility.
Do you think you could check the wiki page for i2c_utility? Do should be able to edit and create pages.
Do you think you could add a page for MCP23017? Please give it a try.
Thanks!
Sorry, curcuit diagram of 2_wire_LCD was wrong. (Pin-number is correct.)
QA->QB, QB->QC, QC->QD, QD->QE, QE->QF, QF->QG, QG->QH
i2c_charLCD and i2c_charLCD_II are codes for 1pc characterLCD.
CHaracterLCD can connect max 8pcs on SDA/SCL, because PCF8574 and MCP23017 have 3 address lines.
Of course, modification need.
I think no one want to connect 8pcs characterLCD.
Result are below;
Expected frequency(500k,1M,2M,4M) don't put out.
In case of 500kHz, pulse-width at Hi and Lo is different.
More than 10000kHz cannot observe by osciloscope.
Where does code wrong?
Pulse more than 20MHz cannot observe on my oscilloscope.
Maybe it seems to work well.
DotCorrection data can read By StatusInformationOutput(SIO).
Removed wire connected to OUT3.
LED conncted to XERR is on.
But data(LOD) from SIO cannot read it.
Do you have any idea?
There is statement in page18 of TLC5940.pdf below;
"The first GS data input cycle after dot correction requires an additional SCLK pulse after the XLAT signal to
complete the grayscale update cycle. All GS data in the input shift register is replaced with status information
data (SID) after updated the grayscale register."
It seems to need need 'SCLK pulse' if SIO need to get.
But it seems to to need update dot-correction register only 1 time.
I think it don't need to be care because strange is only first 1-time.
'Init_TLC5940' set d63 to Dot-Correction registers and 0 to Gray-Scale registers.
Not 'SCLK pulse'.
Photo of demo1 is cimg3583.
This change only gray-scale registers.
Photo of demo2 and demo3 is cimg3585.
This change only dot-correction registers.
Gra-scale registers are all d200. demo2 don't use 'SCLK pulse' in init_TLC5940.
I think SIO data is meaningless.
demo3 use another code(using 'SCLK pulse') instead of 'init_TLC5940'.
I think Reading of Dot-correction registers is correct.
But reading of LOD is incorrect.
Photo of demo4 is cimg3586.
Front of demo4 don't use 'dc_update'.
It seems to be still d63 only dot-correction register of OUT15(right side LED of cimg3586).
In case of rear of demo4, all LEDs are same brightness.
I don't understand why only OUT15.
I cannot compare other chip because I have only 1pc TLC5940.
I misunderstood SIO need 1 SCLK-pulse.
I understood dot-correction register need it.
When dot-correction register change, needing SCLK-pulse only first 1-time afterXLAT pulse.
Sorry, I often have written wrong thing.
So did you get it worked out?
I'm about to start the call, but I don't have the part and driver is a little bit involved, I don't fully understand the situation.
Is the a question we should ask of Sal?
Problems were below;
1. When dot-corrections are changed, only OUT15's dot-correction don't change.
SCLK-pulse after XLAT solved this. ( I misunderstood reading from manual)
2.When getted SIO, LOD(16bit) is always '0'.
SIO(StatusInformationOutput)
b0 - b15 LOD(LED OPEN DETECTION) data
b16: TEF(THERMAL ERROR FLAG)
b17 - b23: unknown
b24 - b119: Dot Correction value
b120 - b191: Reserved
I think Dot Correction value can get from SIO.
But, maybe there are bugs in code because LOD cannot get.
Communication is SPI.
This font is mainly JIS0208.
So, I think maybe this chip is worthless for many propeller users.
Some LEDs is on because registers(GrayScale, DotCorrection) is unknown at power-on.
To prevent this, I think needing pulled up BLANK-pin.
Code need to modify.
VFD model is FHD81X18-0635.
MOSFET(2N7002) is used as level-shifter.
Displayed string'Forth' on VFD.
VFD-controller is PT6312.
Displayed font in ROM-chip on GraphicLCD(WD-G2406B).
Refered curcuit and code about WD-G2406B beliow;
#460 http://forums.parallax.com/showthread.php/138399-Propforth-5.0-is-available-for-download/page23
#31 in this thread.
I bought Adafruit 16X32 matrix.
http://www.adafruit.com/products/420
Yet only this.
http://youtu.be/1mvWV2u12is
I'm trying to display Adafruit matrix.
'demo' write values on d-buf and display them on d-buf.
'matrix_scan' display them on d-buf.
Photo is cimg3628.jpg.
[/] are drawed on surface on panel.
But 'c" matrix_scan" 0 cogx' indicate different result.
There are lines on 8th line of upper and lower.
Photo is cimg3629.jpg.
[C B A] select line number on upper and lower.
I checked [C B A] from outa register on 'line_sh_out_u'.
Both are same.
Why result is different?
Any idea?
Or does it work on cog 6, and not on cog 0?
In both those cases I would guess something didn't get initialized.
Or the pin states that are set by one cog are not reset by the other cog.
If you reboot, and reload the code and run it on cog 0 without running on cog 6, does it have a different result?
That's all that comes to mind at the moment
outa register on cog6 was h1C0 by 'demo'.
I forgot to clear outa register on cog6.
So, [C B A]value is always [1 1 1] although outa register on cog0 change.
8x8-font are displayd on upper section of Adafrui matrix16x32.
This is only 7colors.
Character data(including [A B C]line and [R1 G1 B1] and EN) are placed inside matrix_array(2048bytes).
'test2' continue to scan matrix_array(2048bytes).
But dot with [0 0 0] of [R1 G1 B1] is a little on.
Maybe I think this is ghost.
http://youtu.be/6UtN6g117GE
Adafruit_matrix_0.2_2 is not normal code.
Not defined 2048bytes about array by code.
Before loading; Loaing Adafruit_matrix_0.2_2
Messages in TeraTerm should stop during loading code.
After hitting return-key, loading restart and finish.
Execute 'demo'
Before loading Adafruit_matrix_0.3, execute below; If messages stop in TeraTerm window, it finish by hitting return-key.
http://youtu.be/iTCAMwFCZe4
Printed string"May the Forth be with you. " with green(2) on upper section(0) of Adafruit matrix16x32.
c" May the Forth be with you. " 2 0 adafruit_str
Would you please include the forth code for the optimize instruction as a comment if a version 0.5 is posted?
Is wvariable n an extra loop counter for the third outter loop? I always cringe when I see single character variable names.
I respect i and j for loop counters, those being the names used since the days when names were limited to 3 characters.
But all other names should have some clue at to what they are used for.
Other than than, very nice code, and very cool demo!
Could you maybe creat a wiki page? This is too cool to let it get lost.
n of 'prepare_array'is outer loop counter.
This indicate upper matric(8x32) or lower matrix(8x32).
I'm writing code for printing ROM-chip font(16x16[JIS0208], 8x16[ASCII]).
Code for character finish next.
After it, I want to display full color picture.
I finded out Rayman's thread"Propellering the Adafruit 16x32xRGB LED array".
Maybe I think it cannot translate directly because this use "long OutputArray[32*8*8]"(8192bytes) on Adafruit mateix(16x32).
I cannot understand it yet.