2012-02-20 04:54 AM
2012-02-20 07:23 AM
On a 3210E Eval board I use FSMC Access Mode A, NOR/SRAM bank 1 chip select 4,
Burst Access Mode disable, address setup time 10 (about 14ns), address hold time 0, data setup time 10 (about 14ns), bus turn 0, 16 bit bus. This is based on a 72MHz clock. I found the Ilitek ILI9320 seems to work well with 150ns write cycle, 300ns read cycle. What is the FSMC problem? Jack Peacock2012-02-20 07:58 AM
Hi Jack,
now it's OK with FSMC....but now i can only read the driver code(9320).....2012-02-20 08:11 AM
to distinguish between Status/Index Register and LCD RAM I'am using A[1].......
0x6c00 0000 Status/Index0x6c00 0002 LCD RAMfor both Status Read and Driver Code Read i've got -27872(hex) 9320(dec)2012-02-21 03:13 AM
Here's what I've done...
These are parts of my code.....
#define add_0 0x00000002
// RS of ILI9320 is connected to A[0] of FSMC //
// In case of a 16-bit external memory width(like ILI9320), the FSMC will
// internally use HADDR[25:1] to generate the
// address for external memory A[24:0].
// Therefore HADDR[1] is used as RS
CYG_ADDRESS LCD_base=0x6C000000;
CYG_ADDRESS FSMC_base=0xA0000000;
void
lcd_write(unsigned
char
offset,unsigned
short
data)
{
HAL_WRITE_UINT16(LCD_base,offset);
HAL_WRITE_UINT16(LCD_base|add_0,data);
//0x6C000000|0x00000002
}
short
lcd_read_status(
void
)
{
short
data;
HAL_READ_UINT16(LCD_base,data);
return
data;
}
short
lcd_read_code(
void
)
{
short
data;
HAL_WRITE_UINT16(LCD_base,0x00);
HAL_READ_UINT16(LCD_base|add_0,data);
return
data;
}
void
fsmc_config(
short
offset,
int
data)
{
HAL_WRITE_UINT16(FSMC_base+offset,data);
}
int
main(
void
){
int
fsmc_c1,fsmc_c2,fsmc_c3; //FSMC configuration values
fsmc_c1=0x000050D1; //FSMC_BCR4
fsmc_c2=0x00000D0B; //FSMC_BTR4
fsmc_c3=0x00000B0B; //FSMC_BWTR4
fsmc_config(0x18,fsmc_c1);
//0xA000 0000 + 8(4-1) //bank 1 region 4
fsmc_config(0x1C,fsmc_c2);
//0xA000 0000 + 0x04 + 8(4-1)
fsmc_config(0x104,fsmc_c3);
//0xA000 0000 + 0x104 + 8(4-1) **EXTMOD = ENABLE**
lcd_init();
// this works fine
printf(
''status: %d \t code: %d
''
,lcd_read_status(),lcd_read_code());
// I've got -27872(9320 in decimal) for both
return
0;
}
from the equations for FSMC timing I've got
ADDSET=10(decimal)
DATASET=10(decimal)
maybe i am missing something....
any ideas?
thanks,
Filip.