2012-08-23 12:43 PM
2012-08-23 12:55 PM
You'll need to start by initializing the GPIO pins.
2012-08-23 02:26 PM
oh sure...
GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15; // Initialization of Data pins GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Pin =GPIO_Pin_13; GPIO_Init(GPIOC, &GPIO_InitStructure); when i debug the display screen is white =(2012-09-08 02:00 PM
You'd better use FSMC rather than GPIO for LCD interfacing.
It is much faster and easy to program. If you need, I can share the initialization and simple graphics code and pinout for STM32F4Discovery + SSD1963. It should be easily adaptable for your board.2012-09-08 03:01 PM
You'd better use FSMC rather than GPIO for LCD interfacing. It is much faster and easy to program. If you need, I can share the initialization and simple graphics code and pinout for STM32F4Discovery + SSD1963. It should be easily adaptable for your board.
While this may be the case, the STM32 VL-Discovery board uses a STM32F100 series part, which as I recall does not support FSMC
2012-09-09 03:46 AM
If you want to understand (and modify) this could, you might need to understand the LCD controller. I suggest to download the datasheet of the SSD1963, and use it for understanding the code.
First check which kind of interface your hardware uses. From the code, it looks like 6800 bus interface in 8 bit mode. Using this hardware interface, the controller is parametrized using a register based interface. This is described in more detail in the datasheet of the LCD controller. Albeit the initialization and certain access/graphics routines already exist, it won't do any harm trying to comprehend this.2012-09-12 01:17 PM
i've never programmed a microcontroller and i need to do this =( i have the routines and the ''initialization code'' but doesn't work. can anybody help me? can anybody give me the code? i will be so happy if i can do a circle in the screen.
i'm using the stm32 value line discovery board :(2012-09-12 06:14 PM
You need to provide details of how this controller is wired, and how constants are defined. You should provide enough code that the example is free standing and can be compiled by others. Assume others know absolutely nothing about your hardware and configuration beyond the data you have conveyed in your post.
I'm not sure what bits represent the data register, and if it is high order bits PB.[8..15] you have the fact that SSD1963_DATAPORT->ODR writes low order bits, and trashes high order ones. That the sequence CS=0 WR=0 CS=1 WR=1 should be CS=0 WR=0 WR=1 CS=12012-09-12 07:12 PM
clive1> While this may be the case, the STM32 VL-Discovery board uses a STM32F100 series part, which as I recall does not support FSMC
No fsmc.. Oh, sorry then. Anyway, there are some checkpoints: 1) does writing to registers work? Even if your initialization code is wrong, you should see the display changing while sending commands to it. (insert delays between initialization commands and watch the display. 2) is your initialization code right? You should carefully check it step-by-step with both SSD1963 and the TFT panel datasheet. The code for similar controllers/tft will not work. If your screen is white, either your code is right (1+2+) or you didn't sent even a single command (1-). BTW, your SSD1963_WriteCommand/WriteData code seems to be wrong (you have the 1st case ;) First, the data should be 16 bit. 'int' is 32 bits. Second, the SSD1963_DATAPORT->ODR = ... probably should be in the place of asm('nop') Third, afaik you should set the CS to high to write data, then pulse the WR pin (set it high then low) write the data and reset CS to low. Are you sure you are doing this? Forth, some pin (LCD_RD_PIN ? ) should be set low for a command and high for data, but your WriteCommand/WriteData are identical. and.. where do you call SSD1963_Init() from ? PS: It may be difficult to set up a tft display for the first time, but once you get a point, it is very simple.2012-09-13 12:52 AM
> No fsmc.. Oh, sorry then.
Of couse, no. But apart from being painfully slow, the bit-banging method has the great advantage of being to debug. With single-stepping, you just need a voltmeter. First of all, you might need to supply the VL_Discovery + TFT display with an external power supply. I had a similiar project with a F4 discovery, which overstressed the USB port. It behaved rather strange, until I supplied power externally. Then, check the IM0..IMx pins of the TFT. These pins define the bus interface. There are usually 2..4 of those pins, depending on the number of bus modes supported. And then check that the wiring of your setup does match the selected bus mode. Once you checked everthing is correct, and you have a working (compilable) project, you can examine if your read-command and write-command code provides the right signal/ transition sequences to the correct pins. As said, with single-stepping, a voltmeter is sufficient. I usually do this twice. The first time without TFT, at the GPIOs. The second time I attach the TFT, and measure at the TFT pins. Once this all passed, I suggest to test the communication. This TFT driver chips usually have an ID register at register offset 0. Reading from this address should return the value as given in the driver's datasheet. However, a study of the SSD1963 datasheet and the schematics is mandatory.