AnsweredAssumed Answered

FSMC, getting confused...

Question asked by hunt.greg on Jun 12, 2015
Latest reply on Jun 14, 2015 by hwasti
So I have an STM32 F103ZET. We use a UC1701 controller to drive a small LCD. 

It's attached to FSMC Bank1, 2nd section, using an 8bit wide bus. 

I've been able to write control data using the address 0x64000000 to directly write to memory, but I am unable to figure out how to get the register select pin to toggle so that I can write data out.

Mu understanding was that FSMC_BANK1_R_BASE (0xA0000000) is where I would write control data to, and that I would use the other address to send data. I've been trying various different combinations but haven't had any success yet. With a scope we've seen the C/D pin toggling.

My assumption was that the STM32 chip set the pin high or low depending on the address being written to. The documentation is a little thin on the ground.

Apologies if this sounds a little incoherent. I'm using STM32Cube v1.0 to set up my peripherals. 

This is how I am writing control data:

typedef struct
  volatile uint8_t LCD_REG;
  volatile uint8_t LCD_RAM;
} LCD_TypeDef;

void WriteReg(uint8_t reg, uint8_t byte = 0)
    LCD_TypeDef *lcd = (LCD_TypeDef *)(FSMC_BASE|0x04000000);
    lcd->LCD_REG = reg;
    lcd->LCD_RAM = byte;