A tft addin for pbp3


Closed Thread
Results 1 to 40 of 142

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,714


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    you could do this but ..............
    a big if

    is the portd.7 signal is a limit switch or an emergency stop switch ?... if it is then its best done in hardware a hung loop here could cause fire/smoke/damage or hurt


    '-----------------------OPEN WINDOW ------------------------------------------------------
    IF BUTTON_STATE[2] THEN
    IF BUTTON_STATE[2] >4 then
    if PORTD.7 ==0 then
    PORTD.0=1
    else
    PORTD.0=0
    endif
    else
    PORTD.0=0
    BUTTON_STATE[2]=0
    endif
    endif

  2. #2
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    the portd.7 signal is a limit switch for max position of open window.He must disable opening,but if something goes wrong I will put a second hardware switch to disable motor.
    On test board this routine works good.

  3. #3
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I am stuck with serin2 and serout2 comands.

    I use PIC18F252 for reading sensor.
    BMP085 for temperature and pressure
    DS3231 for time and date
    BH1750 for light intensity
    DHT11 for humidity

    All this values I have on 2x16 LCD and it work perfect.

    pressure and temperature showing on lcd like this


    'DISPLAY true temperature in C
    lCTemp = (B5 + 8) / 16 'Hey presto, lCTemp appears...
    INTEMP = lCTemp / 10 'find value above decimal point
    INTEMPOSTATAK = lCTemp // 10 'Find decimal value
    LCDOut $fe,$c0+12, DEC2 INTEMP, ".", DEC2 INTEMPOSTATAK





    'DISPLAY true pressure in hPa
    lPres = lPres + (X1 + X2 + 3791) / 16 'lPres is the true pressure in Pa
    X1 = lPres / 100+16
    PRITISAK = X1 'find value above decimal point
    PRITISAKOSTATAK = lPres // 100 'find value below decimal point
    LCDOut $fe,$80+9 , DEC PRITISAK, "." ,DEC2 PRITISAKOSTATAK








    Now I want to send all this values to TFT lcd with SEROUT2/SERIN2 commands

    Transminter:

    B2400 Con 16780
    lPres var long
    lCTemp var long

    Sec VAR word
    Mins VAR word
    hr VAR word
    date VAR WORD
    mon VAR WORD
    yr VAR WORD

    PRITISAK VAR WORD
    INTEMP VAR WORD
    DHT_Humidity var word
    lux var word



    Serout2 PortC.7,B2400,["#OK",HR,MINS,SEC,DATE,MON,YR,INTEMP, PRITISAK,DHT_HUMIDITY,LUX]




    On receiver side i have this:

    create two buttons and write receive info on screen


    B240 Con 16780
    cnt var WORD
    HR var WORD
    MINS var WORD
    SEC var WORD
    DATE var WORD
    MON var WORD
    YR var WORD
    LCTEMP var WORD
    LPRES var WORD
    DHT_HUMIDITY var WORD
    LUX var WORD
    buff var byte[32]





    LOP2:

    GOSUB CK_BUTTON
    '*******SET BUTTON FOR ADJUST TIME AND DATE******************************
    IF BUTTON_STATE[0]=1 THEN
    PAUSE 1000
    BUTTON_STATE[0]=0
    ENDIF

    '************NEXT BUTTON GO TO NEXT SCREEN *****************************
    if BUTTON_STATE[1]=1 then
    GOTO SCREEN_1
    BUTTON_STATE[1]=0
    endif

    Serin2 PORTC.0,B2400,10,LOP2,[wait ("#OK"),HR,MINS,SEC,DATE,MON,YR,LCTEMP, LPRES,DHT_HUMIDITY,LUX]

    TEXTSIZE=2
    bg=0
    fg=$7FF
    ' LR UD
    GLCDC 10,200
    GLCDC "Time : "
    ARRAYWRITE buff,[dec2 HR,0]
    GLCDSTR 70,200,buff

    ARRAYWRITE buff,[dec2 MINS,0]
    GLCDSTR 100,200 ,buff

    ARRAYWRITE buff,[dec2 SEC,0]
    GLCDSTR 130,200 ,buff

    GLCDC 10,170
    GLCDC "Date : "

    ARRAYWRITE buff,[dec2 DATE,0]
    GLCDSTR 70,170 ,buff

    ARRAYWRITE buff,[dec2 MON,0]
    GLCDSTR 100,170 ,buff

    ARRAYWRITE buff,[dec2 YR,0]
    GLCDSTR 130,170 ,buff

    ARRAYWRITE buff,[DEC4 LCTEMP,0]
    GLCDSTR 10,100 ,BUFF

    ARRAYWRITE buff,[ DEC4 LPRES,0]
    GLCDSTR 100,100 ,BUFF

    ARRAYWRITE buff,[dec3 DHT_HUMIDITY,0]
    GLCDSTR 200,100,buff

    ARRAYWRITE buff,[dec4 LUX,0]
    GLCDSTR 270,100 ,buff


    GOTO LOP2


    Hr,mins,sec,date,mon,yr and temp are OK

    Pressure are not OK, I have on screen 0235

    Lux and humidity still not connected on transmiter side I have 0 readings

  4. #4
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I just tested a humidity sensor and his value are correct on lcd and TFT but value of lux are ok if are they below 255.
    How to send variable word size over serout2 commands,I think this is my problem.

  5. #5
    Join Date
    Oct 2013
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Solved,

    receive:
    Serin2 PORTC.0,B2400,10,LOP2,[wait ("#OK"),HR,MINS,SEC,DATE,MON,YR , LCTEMP.highbyte,lctemp.lowbyte , LPRES.highbyte,lpres.lowbyte ,_
    vlaga ,vlagaostatak,lux.highbyte,lux.lowbyte ]


    transmit

    Serout2 PortC.7,B2400,["#OK",HR,MINS,SEC,DATE,MON,YR,lCTemp.highbyte,lCTe mp.lowbyte, pritisak.HighByte, pritisak.LowByte,vlaga,_
    vlagaostatak,LUX.HighByte,lux.LowByte]

  6. #6
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    Hi All,

    I'm toying with two different GLCD's, one a 1.8" 160x128 (actually 2 of these but slightly different in overall size and connector with ST7735) and a 2.4" 320x240 with ILI9341, all TFT and 3v3 supply. Using an 18f2520 for testing.

    The larger display works fine however something is awry with the smaller units when I reconfigure Richard's code for the different size and driver. Both exhibit a smaller section of the expected display and some corruption instead of crystal clear and a full screen of scaled icons. The attached photo's show the problem.

    I'm using the last versions of Richard's updates seen on this thread. I went back to the beginning but I don't have a 45k20 on hand to test if the bare bones version works.

    Any suggestions?

    Thanks,
    Bill
    Attached Images Attached Images   

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,174


    Did you find this post helpful? Yes | No

    Default Re: A tft addin for pbp3

    I am sorry that cannot help but I am amazed that your did drive the TFT displays through PIC and PicBasic! Congrats on that. Is it possible to show the code please?

    I am using Nextion to do similar things but it would be nice if an alternative could be used.

    Ioannis

Similar Threads

  1. Replies: 0
    Last Post: - 25th September 2013, 19:33
  2. code examples / libraries for ILI9320 2.8" TFT LCD Module
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2013, 09:50
  3. I really need some help with PBP3
    By Ramius in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th February 2012, 17:05
  4. What's with PBP3?
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th August 2011, 18:09
  5. Experience of driving TFT screens?
    By isaac in forum General
    Replies: 1
    Last Post: - 26th September 2008, 01:15

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts