usafirmware 0 Posted May 28, 2012 Report Share Posted May 28, 2012 What is wrong with this .... #include <pic16F685.h> #define BANK_0 0x0000 #define IOPORTC ((unsigned volatile *)(BANK_0 + PORTC)) #define IOTRISC ((unsigned volatile *)(BANK_0 + TRISC)) .. later on in a function definition ... *IOTRISC &= ~SEGMENT_MASK; // By writing zero's to the bits that correspond to segments, we set them all to outputs This generates a non descriptive error (general error). The code is included as an attachment. Thanks for the help... 7segment.zip Quote Link to post Share on other sites
Pavel 0 Posted May 28, 2012 Report Share Posted May 28, 2012 Please don't use volatile and use intermediate temporary. Something like: #define IOTRISB ((unsigned*)(BANK_0 + TRISB)) ... unsigned *tris = IOTRISB; *tris &= ~SEGMENT_MASK; Regards, Pavel Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.