The µVision3 accepts binary constants with a 'y' or 'Y' as a suffix. The following lines will not be compiled correctly: SSPCR0 = (1111y<<0)|//16 data bits (0<<4)| //SPI (0<<6)| //Clock out polarity (1<<7)| //Clock out phase (1<<8); //Clock rate What is the reason for the message "error C25: syntax error near 'y'"? How do I sign binary constants in program code? I already tried "1111Y", "1111b" and "1111B". No success. Regards Martin
Not the IDE, the Debugger accepts binary data this way. However the 'Y' prefix is not implemented in the compiler. But here is the solution: http://www.keil.com/forum/docs/thread1064.asp
"But here is the solution:" Or the slightly more complete binary constant macros discussed here: http://www.keil.com/forum/docs/thread6896.asp Containing this link: http://www.8052.com/users/dhenry/binconst.h
Many thanks for all the creative solutions!! Regards Martin