That's what I have been using (IDE).
It's been some years since I had any time to do STM programming.
Back in that day I was looking at projects so that I could understand how things worked.
In that time, MX was all that there was.
It's been difficult to get back to speed especially now that I'm older, but being retired gives me the opportunity to learn, although at a slower pace.
I don't use Platform IO and have no desire to do so again. I think it is bloated and an unnecessary resource hog. Just my experiences after trying it a while back.
After configuring the hardware for the LCD for about 12 or so times, each time enabling FSMC, clock sources, Timer 6, FATFS, IO pins and functions, I am down to 247 errors such asCode: [Select]void ili9341_DisplayOff(void)
{
ILI9341_LCDMUTEX_PUSH();
LCD_IO_WriteCmd8(ILI9341_SLPIN); // Sleep
ILI9341_LCDMUTEX_POP();
LCD_IO_Bl_OnOff(0);
}
And I already said it complied on 2 different compilers and blinked the 2 LEDs and the LCD backlight.
I was then that you wanted to jump ship to Platform IO. I don't understand. If I've confirmed your code then where is the issue with doing as you ask?
.
.After adding-changing a few pins, clock sources and accepting migration to the newer FW version, I can report that now the screen is white at startup then goes to blue. See the MX report enclosed.
I still have no idea why the screen is blue from your code. Please explain.
void lcd_fill_col()
{
uint16_t colour = 0xFFFF;
lcd_setwindow(0,0,240,320); // 480,320
lcd_cmd16(ILI9341_RAMWR);
for (int x=0;x<320;x++)
for (int y=0;y<240;y++) // for (int y=0;y<480;y++)
{
lcd_data16(colour);
//HAL_Delay(100);
//lcd_data16(colour);
}
}
I still don't understand. No matter what HEX value is substituted, the screen remains blue. It's like when Henry Ford "invented" the first car, he said "you can get any color you want as long as it's black". It appears to be Intensity rather than Color.
I changed the LCD size to accommodate my 3.2" version 320x240.Code: [Select]void lcd_fill_col()
{
uint16_t colour = 0xFFFF;
lcd_setwindow(0,0,240,320); // 480,320
lcd_cmd16(ILI9341_RAMWR);
for (int x=0;x<320;x++)
for (int y=0;y<240;y++) // for (int y=0;y<480;y++)
{
lcd_data16(colour);
//HAL_Delay(100);
//lcd_data16(colour);
}
}
void lcd_data16(uint16_t data)
{
*(uint8_t*)DataAccess = data;
}
void lcd_data16(uint16_t data)
{
*(uint16_t*)DataAccess = data;
}
Thanks for the reply and the fix. It now does various color shadings as it was intended.
My next favor, is where would I insert the hex code to display a photo.
I know how to convert the photo, but just where to insert it in main.
This would serve to test the LCD's ability to actually show a picture not in cartoon mode.
I never intended to use it for anything other than to learn how to do it on my own.
If you could do this I would appreciate it very much. I'm old and slow but determined. Thanks.
uint16_t picture_array_data[] = {0,10,11,12,13,100,20};// array containing picture data (note example data provide, this wont work without being replaced with actual data )
void lcd_do_picture(void)
{
uint8_t count=0;//set counter to start of memory array
lcd_setwindow(0,0,480,320); //this set the window size for data write
#ifdef EEVBLOG
lcd_cmd16(ILI9341_RAMWR);//ILI9341 and ILI9488 use same values for this
#else
lcd_cmd16(ILI9488_RAMWR);
#endif
for (int x=0;x<320;x++)
for (int y=0;y<480;y++)
{
lcd_data16(picture_array_data[count]);//this take data from stored image location and outputs to the RAM register of LCD
count++;//increment count
}
}
Sort of.....
So where is the "injection point"? Is it in main, and how would it be called in the while loop?
It's time for
Well that was hardly productive.
After removing and replacing the 603 resistor on the right (IM0) and testing the solid color example,
I noticed it didn't work![]()
So in order to test all configurations, I removed all the resistors and made a 6 x 2 header with 3 pins of the bottom row going to GND, then the other 3 going to 3V3.
The header was JB Welded to the LCD board.
The top row of 6 is broken into 3 sets of 2, i.e. #1 & #4 are IM0, #2 & #5 are IM1, and #3 & #6 are IM2.
In this way, adding a jumper to the left bank sends IM# to 3V3.
Adding it to the right sends IM# to GND.
I inserted something more visible in size: 3 1206 5K1 resistors, 1 in each IM# leg going to the LCD board original pad.
IM0 IM1 IM2 | IM0 IM1 IM2
x x x | x x x
x x x | x x x Connect a vertical jumper on each IM# left or right position.
|--3V3--| | |--GND--| Only one jumper for each at a time.
Photo(s) to follow.It's time for
Now that I'm awake I can think a little better. What was shown in all permutations of the jumper swaps was nothing but a blank white screen with some initial flashing but steady gray after a half second with no change after.
I'd like to know what R1 - R6 & R4 - R7 do. I still don't know.
Here are some photos of the "quick and still dirty" IM config test mod but they do work. They will be cleaned up later.