Hi,
I have a problem.I must send through the serial port the number 1 and the number 0 every second using a timer of the c167cs. Would someone know me to help?
Another thing: Why do you declare a as int? You are programming an 8-bit processor and int is in this case a 16-bit data type. Using a data type larger than the native register size is not recommended unless you need the range.
The C167 is a native 16-bit microcontroller.
PS. I added the toggle to P2.0 since the Phytec board has LEDs connected to P2.
I was completely convinced that I saw C51 as architecture when I wrote the comment.
Anyway, a number of embedded processors has limited RAM space and special instructions for bit variables, so all variables should get their type based on a consious decision.
Yes, I thought as much, just wanted to point this out for other users.
I would just make a comment to the generated code for the C166 is usually (from a code standpoint) not as efficient when using a byte variable over a word variable (usually you end up with an extra instruction).
Per as you stated the user must decide what memory allocation is important for their application. I also appreciate your suggestion of an add instruction instead of an if statement.