Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ILI9341 with SW/HW SPI, 8/16 Bit parallel mode
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Sun May 17, 2015 9:20 pm    Post subject: Reply with quote

NTSX2102 are nice indeed, but hell .... a pitch of 0.5mm ! That's OK for professionally made boards, but for home-made boards it's a challenge.
And for the more vintage Bascom users: An easier to handle levelshifter is 74LVX125. Available in DIP and SOIC.

Cheers

Nard

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Fri May 29, 2015 5:46 pm    Post subject: Reply with quote

A different interface approach. I ditched the zeners and use Schottky diodes instead with a pull-up resistor network. Schematic attached as zipped .png

I also found a parallel version (8bit) of this board, with resistive touch. No touch-chip though ! The touchpanel shares pins with the display. Which means that these pins are interconnected with 250 resp. 400 Ohm of the panel !
Spent quite some time on it but every now and then it locks up. Latch-up presumably. HC245's are no levelshifters. I may use it in the future with an Arduino or ATXmega on 3.3V

Nard

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
AndersL

Bascom Member



Joined: 25 Jan 2010
Posts: 89
Location: KragerÝ,Norway

norway.gif
PostPosted: Mon Jun 01, 2015 1:25 pm    Post subject: Reply with quote

Thanks Netzman for your nice library Very Happy
In order to get the modified M328 lib working on a M1284 I had to add a ordinary Bascom SPI setup/init:

Code:
Macro Lcd_ctrl_init
         in R16, Lcd_ctrl_ddr                               ' configure SPI output pins
         ori R16, Lcd_ctrl_output_mask
         !out Lcd_ctrl_ddr, R16

         #if _xmega = False
            Lcd_spi_status = Lcd_spi_status_init
         #endif

         'Config Spic = Hard , Master = Yes , Mode = 0 , Clockdiv = Clk2 , Data_order = Msb , Ss = None
'******** The following to lines has been commented out and replaced by Bascom SPI setup/init. AndersL  *********************************
         'ldi R16, Lcd_spi_ctrl_init
         '!out Lcd_spi_ctrl, R16
         Config Portb.4 = Output                            'SS pin. Not used,but needs to be set for SPI Master
         Portb.4 = 1
         Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 4 , Noss = 1
         Spsr.0 = 1
         Spiinit
      End Macro
 


With this change it works very good with M1284 @3V3/11.059MHz

Edit: In the bas file it should be $include "ILI9341_M1284_revA.inc" offcourse

_________________
Anders
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Thu Jun 04, 2015 3:09 pm    Post subject: Reply with quote

Guys,

I tried to update the True Type Font Converter, found in folder Tools, and get a warning from my AntiVirus. False positive ? I don't like to disable AV-protection Sad

Oh, ... and I didn't give up on the 8bit parallel version with resistive Touch. Will post it when I am done testing.

Nard

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Thu Jun 04, 2015 4:04 pm    Post subject: Reply with quote

I am trying to use a larger font: color16x16.font as found in Samples/LCDGRAPH
to use with the ILI9341 library

I have seen troubles before caused by the header info:
Code:
'Color
color16x16:
$asm
.db 2,16,32,0  <----- these
.db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;  
.db 0,0,192,0,192,0,192,0,224,1,224,1,224,1,224,1,192,0,0,0,192,0,224,1,192,0,0,0,0,0,0,0 ; !
etc
 


Any clue to help me out ? Or needs the
Code:
Sub Lcd_text(byval S As String , Byval Xoffset As Word , Byval Yoffset As Word , Byval Forecolor As Word , Byval Backcolor As Word)
to be re-written ?

Thanks.

Edit: added picture

Nard

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"


Last edited by Plons on Thu Jun 04, 2015 5:34 pm; edited 1 time in total
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Thu Jun 04, 2015 5:32 pm    Post subject: Reply with quote

In the meantime I built a package with the ILI9341 TFT with resistive Touch of which the pins are shared with the TFT. Pictures are in the zip.
Ili9341_8bpar_2560_touch_r5_forum.bas is the main file.
Ili9341_inc_revK.inc is the revised lib as created by Mathias (Netzman)

The timing of the control-signals in parallel mode is improved in revI of the include,but that was unnecessary. My bad. Modified it back to Mathias' version.
The initialization of the LCD is altered (I got a stripy display), and of course the macro for the Touch was added. To prevent unnecessary current consumption by the Touch-panel, LCDdata is set to &HFF at the end of a write action. Saves 30mA ! And that's a lot when running on battery.

In your own program, call the Macro Read_touch every 1ms. If that's too much time-consuming, once every 5 ms is okay too, but reduce the Const Touch_debounce = 12 to 4.
The touch macro keeps track of the current orientation.

......

Due to the layout of this TFT, the LCD data bus is spread over 3 ports when used on a Arduino Mega2560. Grrrr.
The shortcut I took is re-routing the LCD bus to PortA and SD - SPI to the true SPI pins on the double row connector. This modification is done on the proto-shield, so no messing with the display or the Arduino. See picture

Enjoy

Nard

Edited June 7, 2015, 01:02 local time

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
sultanm9000

Bascom Member



Joined: 23 Aug 2014
Posts: 40

uk.gif
PostPosted: Tue Sep 29, 2015 3:09 pm    Post subject: ILI9341_8bit_par_Touch_forumK5 Reply with quote

Hello
I need to draw connections this forum please
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Tue Sep 29, 2015 5:46 pm    Post subject: Reply with quote

It's unclear to me what you want/need. Please elaborate.
_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
sultanm9000

Bascom Member



Joined: 23 Aug 2014
Posts: 40

uk.gif
PostPosted: Tue Sep 29, 2015 9:52 pm    Post subject: Reply with quote

schematic For Circuit
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Tue Sep 29, 2015 10:38 pm    Post subject: Reply with quote

The library is universal. So there is no such thing as a pre-defined schematic.
_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
sultanm9000

Bascom Member



Joined: 23 Aug 2014
Posts: 40

uk.gif
PostPosted: Wed Sep 30, 2015 8:42 am    Post subject: Reply with quote

I need a project to turn on the display (LCD_ILI9341) with the touchpad for Bascom AVR and thank you "Plons
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Wed Sep 30, 2015 12:44 pm    Post subject: Reply with quote

Attached the schematic of the ArdMega2560/LCD_ILI9341wT part of my project.

This code is in my MainProgram and reflects the HW in the attachment.
Code:
Const Lcd_enable_backlight_pwm = False
Const Lcd_backlight_port = Portd
Const Lcd_pin_backlight = 7

Const Lcd_enable_spi = False
Const Lcd_use_soft_spi = False
Const Lcd_enable_16bit = False

Const Lcd_ctrl_port = Portf
Const Lcd_data_port_1 = Porta

Const Lcd_pin_dc = 2
Const Lcd_pin_cs = 3
Const Lcd_reset_pin = 4
Const Lcd_pin_wr = 1
Const Lcd_pin_rd = 0

'Const Touch_res_shared_pins = True   'for revL only

$include "Ili9341_inc_revK.inc"


This forum's intention is to give help to fellow users. Not to do the work. Time to show us a bit of your efforts, Sultan !

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
sultanm9000

Bascom Member



Joined: 23 Aug 2014
Posts: 40

uk.gif
PostPosted: Wed Sep 30, 2015 5:03 pm    Post subject: Reply with quote

Plons
Where (forum) for this scheme?
Thank you Plons
Back to top
View user's profile
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Wed Sep 30, 2015 5:15 pm    Post subject: Reply with quote

The library I posted here: http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=68399#68399

(Not sure but I think that this is what you meant)

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
sultanm9000

Bascom Member



Joined: 23 Aug 2014
Posts: 40

uk.gif
PostPosted: Wed Sep 30, 2015 5:26 pm    Post subject: Reply with quote

Thank you M.Plons
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum