cancel
Showing results for 
Search instead for 
Did you mean: 

How to toggle the Ax pin when using fsmc

Cobus Hoffmann
Associate II
Posted on February 20, 2017 at 00:30

I am trying to implement FSMC in order to drive an ili9341 LCD in 8080 mode. However to distinguish between command and data I need to toggle the RS(register select pin) which according to reference manual AN2790 should be connected to pin Ax. It appears that the Ax pin is just always LOW, and I don't know how to toggle it. 

I am using HAL_SRAM_Write8b(&hsram1, (uint32_t *)0x60000000, buff, sizeof(buff)); and it appears to work as I can toggle the LCD display on and off, which leads me to beleave that it recognises commands I just need to toggle Ax HIGH so that I can send paramaters.

I am using an stm32f407vgt6.

#stm32f4-discovery #lcd #fsmc #tft #sram
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on February 20, 2017 at 04:00

You posed a question about A16, I provided you the context for the 0x60000000 + 0x20000 for the 16-bit case, and your 8-bit case.

For A0

(1 << 0) = 0x1 // 8-bit

(1 << (0 + 1)) = 0x2 // 16-bit

For Ax

(1 << x) // 8-bit

(1 << (x + 1)) // 16-bit

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

View solution in original post

6 REPLIES 6
Posted on February 20, 2017 at 01:58

Access an address where the address bit in question get to be high. ie 0x60008000 (A15 8-bit mode, A14 16-bit mode)

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on February 20, 2017 at 02:24

If I can just find where the addresses are mapped I would understand. If there is like a table with the mappings that would be super helpful. I have looked around everywhere and everyone uses addresses:

0x60020000 for ram and 0x60000000 for command but they all use 16bit mode.

I am using 8bit mode and I want with A

The attachment is an excerpt from the TFT LCD document mentioned above and lists some addresses for A0 and A4, but I don't know how they get those values

________________

Attachments :

Capture.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hytb&d=%2Fa%2F0X0000000bDn%2FVNLXzyubon3CnRO5595EfwhL4DmecMNll_fH4Zt.XUw&asPdf=false
Posted on February 20, 2017 at 02:54

The 16-bit bus doesn't need an A0 pin so the address bits on the bus shift, it's explained in either the Data Sheet or Reference Manual on the FSMC if you need some confirmation. It is a binary bus, you really shouldn't need a table.

(1 << 16) = 0x10000 // 8-bit

(1 << (16 + 1)) = 0x20000 // 16-bit

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on February 20, 2017 at 03:51

Why are you still shifting it left 16bits if in your first example it is 8bit mode?

Is it because I am using A16?

Posted on February 20, 2017 at 04:00

You posed a question about A16, I provided you the context for the 0x60000000 + 0x20000 for the 16-bit case, and your 8-bit case.

For A0

(1 << 0) = 0x1 // 8-bit

(1 << (0 + 1)) = 0x2 // 16-bit

For Ax

(1 << x) // 8-bit

(1 << (x + 1)) // 16-bit

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on February 20, 2017 at 04:19

Thanks for all the help, that worked