[Solved] PIC18F47K40 - Troubles Using Table Reads
I'm having troubles reading data from an array stored in the program memory. Please have patience with me as I'm a newbie.
HW: PIC18F47K40 on Curiosity HPC board and Mikroe OLED W Click board populating the MikroBUS slot 1. Power supply set to 3.3V.
SW: MPLAB X IDE v5.40, XC8 v2.30
MCC - latest version, I think, to configure pins and peripherals.
The IDE has all updates applied almost as soon as I was prompted to.
I have a 480 bytes long array defined as const so it is stored in the program memory - this works, I've checked the memory view.
I want to read this, byte by byte, and write these bytes to the display (the OLED click);
So far, from what I can tell, the problem seems to be that, due to some reason that escapes me, the TBLRD* instruction is not executed.
This is my main.c:
extern const uint8_t font;
extern const uint8_t xpress;
// Initialize the device
//test copying a variable from a program data stored array
xpress_buff=xpress; //somehow this fails
xpress_buff=xpress; // as does this
xpress_buff=xpress; // and this
//end test */
//fill the screen with a checker board pattern -> this works
for( i=0; i<5; i++) // 5*8=40 pixel rows (actually 39)
for( j=0; j<96; j++) // 96 pixel columns
//end screen fill test */
I've run this code step by step in disassembly view, and thus I came to the conclusion that the TBLRD* does not seem to work. The Table pointer registers are loaded with the correct values, but when TBLRD* is executed, the TABLAT still reads 0x00, though it should certainly read something else.
post edited by PICnik - 2020/09/29 08:10:50