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 User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,824
    Likes:
    959
    Location:
    Rochdale UK
    ONLINE
    I have built the prototype..

    I'm getting 16.66Mhz SPI with no problems.... I have had to move to MODE1 ( low idle and clock on trailing edge )..

    As I have a 240 x 320 screen Update seems a tad slower than yours Eric.. I have the chip at 64Mhz on the internal OSC and PLL... so I can't go any faster!! I'm taking it home for Christmas so I can play and get a video done..
     
    • Like Like x 1
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi Ian,
    That's a fair SPI rate.
    I found that the Arduino routines used Unsigned WORD's for the pixel settings, checking shows that the High Byte of the address Word is always 0x00.
    Passing a BYTE for X and Y Addressing [ a WORD for colour is required] saves a little time and memory space..
    Also IMO the additional external Calls within the Set Pixel procedure are time wasting, I have added the Code in these external Calls to to the Set Pixel procedure.

    If you are using Oshonsoft Basic.? check the operation of the RS232 serial HW UART, I had to Define the Clock as 60MHz, even though the actual internal clock was 80MZ, in order to get the correct division rate for the HW UART.

    E
     
  3. Ian Rogers

    Ian Rogers User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,824
    Likes:
    959
    Location:
    Rochdale UK
    ONLINE
    I Lied!! I have re-witten the LCD clear function and is now the same speed as yours...
    Nope!! Gave that up ages ago... MPLABC18!! I haven't started on the USART!! The pic18f26k80 has a second USART on the programming pins, So they are already exposed...
     
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi,
    Using the PIC's onboard ADC, set for Byte output, ie: 0 thru 255 counts, using SetPixel, the 9225 LCD displays a very good 5Vppk 100Hz waveform.
    Lower ppk sine and triangular waveforms upto ~200Hz look OK.

    As the waveform pixel is set, the 'y' component [theADC output count] is also stored in a 250 long buffer.
    When the next waveform sweep occurs, the buffer is Read and the pixel set as Black just before the current pixel is set.
    This erases the 'old' plot one pixel at a time just before the new pixel is set.
    By using alternate colours for each sweep, it makes it easy to view the TFT/signal waveform.

    The X axis timing is set by a delay between plots and increments by one for each ADC reading.

    E
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi All,
    I was just looking through this post with interest, but it is something for me in the future.

    These are the screens I bought : https://www.ebay.co.uk/itm/2-0-TFT-...-Arduino-CG-/162275748618?hash=item25c8636b0a
    Would they work with the Programs here?

    On a different point, regarding Crystals. When choosing crystals for a PIC, is it best to go for the fastest shown in the data sheet, or one that divides better for the project, 'say' 16MHz?
    C.
     
  7. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,905
    Likes:
    128
    Location:
    Buenos Aires - Argentina
    ONLINE
    Beau Schwabe

    Hola Beau,

    What is that random part for? Intrigued.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  9. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,723
    Likes:
    711
    Location:
    Derbyshire, UK
    ONLINE
    I bought a couple of those, unfortunately they need a LOT of I/O pins to use, as it's a parallel interface.

    Clock speed depends entirely on what you're doing, mostly I choose PIC's with internal oscillators and don't use external crystals, it wastes two I/O pins on any remotely modern PIC.
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi N,
    Ok, thanks.
    I did say sometime in the future, so it looks like a distant future if at all.
    C.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice