We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I want to link the port P9 to a LCD with a 80C509. I have already linked a keyboard to the port P4 and I manage to declare a bit with this instruction: sbit P4_0 = P4^0; but when I try the same thing whit P9, the compiler says to me: P9 : invalid base adress I think it's because P9 is not bit adressable but I'm not sure. So I try to read the value of P9 with this instruction: unsigned char val = P9; but the compiler says: error C247: non-adress/-constant initializer It seems that P9 is a constant, I can read its value but I can't change it. Is someone who know how to do to change the value of P9? Thanks. ps: Sorry for my bad english, I'm a french student ;-).
error C247: non-adress/-constant initializer
#include <reg52.h> unsigned char global_val = P0; void main (void) { unsigned char local_val = P0; }
Thanks for the info Mr Neil. I found a solution. I have just written:
void main (void) { P9 = 0x5F // 0x5F is an example }