So I am doing a project where I need to interface an TFT LCD 240*240 ISP ST7789 with C8051f120 microcontroller using SPI interface I have written the program but I am not getting Output on LCD would appreciate if anybody will help :) here's my code do let me know if there's any problem with code. P.S I have initialized the port and mcu parameters in c8051f120.h
#include <c8051f120.h> #include <tft.h> #include <stdio.h> #include <stdlib.h> #include <intrins.h> sbit SPI_SCLK=P2^1; sbit SPI_MISO=P2^3; sbit SPI_MOSI=P2^2; void main() { SFRPAGE = SPI0_PAGE; delayms(100); ST7789V_Initial(); delayms(100); SPI0CN = 0xF8; Draw_Circle(); BACK_COLOR=WHITE; POINT_COLOR=RED; delayms(140); } void Draw_Circle(unsigned int x0,unsigned int y0,unsigned char r,unsigned int color) { int a,b; a=0;b=r; while(a<=b) { LCD_DrawPoint(x0-b,y0-a,color); //3 LCD_DrawPoint(x0+b,y0-a,color); //0 LCD_DrawPoint(x0-a,y0+b,color); //1 LCD_DrawPoint(x0-a,y0-b,color); //2 LCD_DrawPoint(x0+b,y0+a,color); //4 LCD_DrawPoint(x0+a,y0-b,color); //5 LCD_DrawPoint(x0+a,y0+b,color); //6 LCD_DrawPoint(x0-b,y0+a,color); //7 a++; if((a*a+b*b)>(r*r)) { b--; } } }
- the target is supported by Keil: https://www.keil.com/dd/chip/3469.htm
- https://www.keil.com/dd/vtr/3469/7009.htm
- an idea is to also contact SiLabs Support: https://www.silabs.com/support
Btw, what version of PK51 are you using?