1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

TFT LCD Projects/Ideas/Applications Open Discussion.

Discussion in 'Oshonsoft' started by ericgibbs, Nov 16, 2017.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Mine has an external LED connection... I have a 100 ohm to 5v..
    upload_2017-11-21_14-32-10.png
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,331
    Likes:
    653
    Location:
    Derbyshire, UK
    I think they all have external LED connections?, I usually use a 39 ohm resistor (for either 5V or 3.3V), I don't think you really need one though as they have resistors on board - but I'm much happier fitting one.
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    What surprized me was the need for a pullup on pin 10 of the Arduino!!! Didn't know it was an open collector output!!
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK

    Just ported to a pic18f26k80... I was in the midst of converting the C++ from Arduino to C for XC..

    WhenI was on the Amazon page , right in the corner of my eye, I saw this:-
    http://tftdata.tjc1688.com/2.8_spi/2.8-spi-9341.rar
    On opening said RAR I found C drivers for LCD driver, Touch driver and SD driver... For several platforms..

    Lots of Chinese remarks, but I spent very little time making it run with the pc!!! These guys have written all manner of items in a graphical library..
     
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi.
    Non of the three 9225 TFT's, all with a pin marked LED, will not give a back lite output.
    Tried 100R pull up, pull down even a direct connection, no effect.

    E

    Ian,
    Downloaded from your link, looks interesting

    UPDATE:
    Traced the copper track for the LED pin, it ends in an open track SMD resistor pad.
     
    Last edited: Nov 22, 2017
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Ian Rogers , Nigel Goodwin
    Ref my TFT back light problem.
    This image is a shot of the back of my 9225 TFT.
    Note the PCB track from the LED pin, next to to unused SMD pad is a badly hand soldered 4R7 resistor.
    I would appreciate if you could compare the back of your TFT PCB's for any obvious differences.
    E
     

    Attached Files:

  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Mine has a 39 ohm resistor in place
    upload_2017-11-22_19-10-40.png
    R6.... But remember mine is a ILI9341..
     
    • Informative Informative x 1
  9. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,331
    Likes:
    653
    Location:
    Derbyshire, UK
    OK, I've checked all my MANY different TFT's :D

    Some you can't see a resistor feeding the LED, or even the track - but there could be a resistor on the other side of the board of course.

    Of those with visible resistors, they are 2.2, 3.9 and 4.7 ohms on the different boards.

    My 9225 boards Eric are different to yours, I can't see an LED resistor on them, and there's a voltage regulator above the level shifting chip, where yours has the two resistors (or at least space for two).

    The one labelled R6 in Ian's picture is 3.9 ohms on my (identical) boards.
     
    • Informative Informative x 1
  10. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I'm going to direct this question to you Nigel Goodwin !! As you have played with the ili9341.

    There is a DE pin... Apparently used in RGB mode... Have you tried this in 4 pin serial mode? In RGB mode you can keep this low whilst loading data, then make it high to enable the display ram -> screen.. I was hoping to make screen updates look seamless.... Other than that I will try and jack a 16MHz xtal up to 64Mhz and see if the SPI can handle the speed..

    The Arduino seems to be a tad faster at the mo.. The pic is clocked at 32Mhz ( SPI of 8Mhz) and the Arduino is clocked at 16Mhz ( SPI also at 8MHz ).... The Arduino seems to have the edge...

    Controlling the screen refresh will help a lot!!
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Nigel Goodwin Ian Rogers
    Completed the TFT 9225 programs using Oshonsoft Basic, if anyone is interested I will tidy up and post.

    Using the smallest Font for the display have written a routine that 'magnifies' the small font table by 2,3 or 4 times, the displayed character results are acceptable.

    E
    9225image1.jpg

    EDIT:
    Modified the '3' , '6' and '7' font symbols, more rounded.
     

    Attached Files:

    Last edited: Dec 1, 2017
  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Using a 18F4520 and a 20MHz crystal with the internal 4fosc * PLL, the 9225 is now running at a 20MHz clock rate.
    The TFT updates are very fast, the only down side at the moment is getting the UART baud rate set correctly using Oshonsoft Basic.
    To check that it is not a one off, I will try the project using a number of 18F4520's at this setting.
    Also modified some of the translated Arduino code, which IMO was very inefficient.

    E
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I'm working on a video buffer... Simple scaling... 4bit RGB with intensity.. Just like the old EGA monitors..

    Using a 16 word lookup I can split the byte into two and look up one of 16 colours then send... This way you could have two lookups and swap between them ... Simple animation trick... 2k will give a 64 x 64 sprite...
     
  14. Beau Schwabe

    Beau Schwabe Member

    Joined:
    Jun 4, 2017
    Messages:
    45
    Likes:
    5
    Here is a 7 Inch touch screen display from 4D Systems that I am using on a precision X,Y,Z cutting machine. The Display communicates with a PIC18F4550 micro controller on board the main machine with a simple 6 BYTE protocol ..... BYTE1 and BYTE2 are SYNC bytes .... BYTE3 is an Address .... BYTE4 is the data (to write to the address) .... BYTE5 is a Simple CRC, and BYTE6 is a random Seed.

    CRC = BYTE1 ^ BYTE2 ^ BYTE3 ^ BYTE4 ^ BYTE5 ^ BYTE6
    CRC = (CRC<<1) && $FF ; <-- This line optional but adds some robustness to the CRC 20171204_152358.jpg 20171204_152522.jpg
     
    • Informative Informative x 1
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Ref the UART problems with Oshonsoft.
    18F4520 , 20MHz xtal, PLL *4, so Fosc =80Mhz.
    Oshonsoft is unable to set the SPBRG values close enough to get correct UART timing, tried using ASM but still unable to set Baud rate to 9600.

    So in the Basic program I Defined the Clock as 60MHz and also in the Oshonsoft clock options box to 60MHz.

    The UART now works fine at 9600 Baud, the SPI is still showing a 20MHz clock rate.!

    Go figure, observations welcome.;)
    E
     
  16. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi,
    Using my mobile phone camera I am unable to get a satisfactory video of the 18F4520 with TFT 9225 running a Oshonsoft Basic program.
    Getting interference patterns on the video display, due the TFT and camera pixels.
    Will try to find a an alternative camera,

    For any Oshonsoft users, the Demo program attached, when using a18F4520 with a 20MHz Xtal and the 4*PLL enabled, the TFT runs at a fast rate.
    The font table is called as an Include file in the Basic program, so load it into the same folder as the *.bas.

    Eric.

    The program has these Objects as Procedures, commented at the end of the Code.
    'all variables are global dims
    'the program uses hardware SPI functions.
    call clear(color As Word)' full screen clr
    all WORD's
    call hori_line(x1 start, x1 end, @y0, color)
    call vert_line(@x0, y0 start, y1 end, color)
    call diag_line(x0 , y0 ,x1 y1, color)
    call rectangle(x0 , y0 ,x1 y1, color)
    call fill_rect(x0 , y0, x1, y1, color)
    call draw_circle(x0 , y0 ,x1 y1, color)
    call fill_circle(x0 , y0, x1, y1, color)
    call msg2lcd(x0 As Word, y0 As Word, msg1 As String, color As Word, bg As Word) ' with Font size option.
    call msg2bfr(x0 As Word, y0 As Word, msg1 As String)
    call bfr2lcd(x1 As Word, y1 As Word, color As Word, bg As Word)

    'the lcd addressing has been normalised so that Xorg, Yorg is at
    'the bottom left corner of the lcd, in Landscape mode, x0,y0
    'pin connects On right side.
    'the long edge is the x axis [0 to 219] and the narrow is the y axis [0 to 175]

    'for writing text, lower left pixel is the lower left of the character, the following
    'character bits are written upwards.

    'for drawing objects, the bottom left corner is x0,y0 is the object start and
    'x1,y1 is the objects finish coords.
     

    Attached Files:

  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    ONLINE
  18. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,331
    Likes:
    653
    Location:
    Derbyshire, UK
    Nice one Eric, quality is fine - it's difficult to make close up videos :D
     
  19. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Cool
    I'll upload mine when I get a chance.... Funny thing.. Mine looks identical to yours, but mine is a ILI9431???
     
  20. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Excellent work! The quality is fine for me.
    C.
     
  21. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,331
    Likes:
    653
    Location:
    Derbyshire, UK
    A lot of the TFT boards look VERY similar, but use completely different chips - often it's quite difficult to find out what your board uses.
     

Share This Page