87
C-Control Pro Mega Series
Global Variable
---------------------------------------------------------------
Total Length:
Local Variable
-----------------------------------------------------------------
Function Pulse()
count
i
Total Length:
Function main()
count
n
Total Length:
From this list can be seen that no global variables are being used. There are further the two functions
"Pulse()" and "main()". Each one of these functions consumes a memory space of 4 Bytes on local
variables.
5.2
CompactC
One possibility to program the C-Control Pro Mega 32 or Mega 128 is offered by
the programming language CompactC. The Compiler translates the language
CompactC into a Bytecode which is then processed by the Interpreter of the C-
Control Pro. The language volume of CompactC does essentially correspond with
ANSI-C. It is however reduced to some extent since the firmware had to be
implemented in a resource saving way. The following language constructs are
missing:
· structs / unions
· typedef
· enum
· constants (const instruction)
· pointer Arithmetic
Detailed program examples can be found in directory "Demo Programs" which was installed along
with the design interface. There example solutions can be found for almost every field of purpose.
The following chapter contains a systematic introduction into syntax and semantics of CompactC.
5.2.1
Program
A program consists of a number of instructions (such as "a=5;") which are distributed among
various Functions. The starting function, which must be present in every program, is the function "
main()". The following is a minimalistic program able to print a number into the output window:
void main(void)
{
0
bytes
4
bytes
4
bytes
Length
Position (RAM Start)
Length
Position (Stack relative)
2
4
2
0
2
2
2
0
© 2008 Conrad Electronic
Need help?
Do you have a question about the C-Control Pro Mega Series and is the answer not in the manual?
Questions and answers