Re: Read status register Micron Serial NOR Flash Memory MT25QL128ABA
I have no own experience with the Micron MT25QL128, but from the datasheet I suspect the following issues:
You did'nt specify your compiler nor PIC (which you also should always do), now its not clear whether you are using 32 bit or 16 bit.
Your function getFlashID suggests that you are using 32 bit integers, otherwise it would not work.
Thus you are forming a 32 bit mixed value from the Manufacturer ID (1 byte) and Device ID (2 byte), you probably are aware of that.
As shown in your RREG function you are still handling the status register as 16 bit register, which I think it is NOT. It's just an 8 bit register. You are allowed to read it in a loop/continuously e.g. to check for a certain status, but it would usually not make much sense to OR it like you did.
Please read the data sheet, e.g. Table 23 READ Register operations and also see the Figure 30 below.
You did not not describe how your results looks like. You always should explain what you expect and what you get.
Otherwise this is all guessing, we don't know what you think is ok or wrong.