echo '' ;

Category Archives: IDE

MP LAB

Shortcut 

  • Search word in whole project (SHIFT + Ctrl + F) 
  • Search word in current file (Ctrl + F) 
  • Change Font size Increase/Decrease in file (Alt + Mouse scroll ball)

TIME and Date

  • __DATE__
  • __TIME__

using __TIME__ and __DATE__ with the xc8 compiler I’m able to get the time and date as strings. As I don’t have a RTCC and only limited program and data memory, I want to implement the time & date functionality as efficiently as possible. So I’ve tried to use macros and thought this would save some memory, but unfortunately it does not.

  • For example: this is the code I use to get the starting hour as an int:  

#define BUILD_HOUR ((__TIME__[0] - '0') * 10 + __TIME__[1] - '0') int hour = BUILD_HOUR;// start value

I assumed that the preprocessor and compiler would optimize this, so I would not get a lot of addidtional memory usage. But the whole cumputation is done by the pic 12F1572 I use. Is there a better solution for this problem or any workaround ?