Nope, now I get 0b11111010, and the delay is not good, it is much faster now.
I think the clock speed is now 64MHz.
If you look at the datasheet for 18F46K20, OSCCON=0b01110000 setting is for 16Mhz.
If we add 4xPLL, 16MHz x4= 64MHz
- - - Updated - - -
I turned off PLL, and set OSCCON =0b01100000, set the cpu to 8Mhz, and I get the same character as for 32MHz with pll
If I put OSCCON =0b01110000, and set cpu to 8Mhz, I get 0b11111010, the same as on 64Mhz
I also tried many other combinations, and never get the 'X' character
- - - Updated - - -
This setting is good: OSCCON =0110 0000 - 8MHz Intosc, PLLEN=1 - 4x PLL, -> MCU clock =32MHZ
It is working now, I tried some different code from other project.
The problem is probably in the compiler, it is generating errors in hex file.
I made this conclusion when I tried to send longer string via uart.
Thanks for help!