C-Control Pro Mega Series Table of Contents Part 1 Important Notes 1 Introduction ...................................................... Reading this operating manual 3 Handling ........................... 4 Intended use ...................................................... Warranty and Liability ........................... Service 7 Open Source ........................... 8 History ........................... Part 2 Installation ...........................
Item Technical Data in the attachment. Warranty and Liability For the C-Control Pro Unit Conrad Electronic grants a warranty period of 24 months from the date of billing. Within this time period faulty units will be replaced free of charge if the fault provable originates in faulty production or loss on goods in transit.
Service Conrad Electronic provides you with a team of experienced service technicians. If you have any question with regard to our C-Control Pro Unit you can reach our Technical Service by letter, telefax or e-mail.
Page 14
C-Control Pro Mega Series · Editor supports code folding · Simple serial Terminal · Pulldownmenu to start your own programs (Tool Quickstart) · Syntaxhighlighting of all standard library functions · Configuration of Syntaxhighlighting · Extension of Select .. Case in BASIC ·...
Page 16
C-Control Pro Mega Series · Version Number in Splashscreen · Extended Documentation · Interactive Graphics at "Jumper Application Board" in Help File · New Demo Programs · Ctrl-F1 starts Context Help Error Corrections · An Error is created if the Return Command is missing at the end of a function ·...
C-Control Pro Mega Series Installation In this chapter the installation of hardware and software is described. Applicationboard Important Note on Inserting/ Retrieving a Mega Module For the connection between Module and Application Board high quality connectors have been used in order to ensure intimate contacts. Mounting and dismounting of a Module should only take place during power-down condition (switched off voltage) since otherwise damages may occur to Application Board and/ or Module resp.
C-Control Pro Mega Series The message "C-Control Pro USB Device has not passed the Windows Logo Test .." will normally appear. This does not mean that the driver has failed during the Windows Logo Test. It merely means that the driver has not taken part in the (quite costly) Redmond Test.
C-Control Pro Mega Series Hardware This chapter gives a description of the hardware coming into operation with the C-Control Pro series. The Modules C-Control Pro Mega32 and C-Control Pro Mega128 will be described. Further chapters will comment on construction and function of the accompanying application boards and LCD modules as well as the keyboard.
C-Control Pro Mega Series LCD Matrix The complete datasheets are on the CD-ROM in the directory "Datasheets". CHARACTER MODULE FONT TABLE (Standard font) Character modules with built in controllers and Character Generator (CG) ROM & RAM will display 96 ASCII and spe- cial characters in a dot matrix format.
Page 28
C-Control Pro Mega Series If x is a digital measuring value then the corresponding voltage value u is computed as follows: u = x * Reference Voltage / 1024 Clock Generation Clock generation takes place by a 14.7456MHz Quartz Oscillator. All time dependent actions within the controller are derived from this clock frequency.
C-Control Pro Mega Series Clock Clock Frequency (Quartz Oscillator) 14.7456MHz Mechanics Overall measurements less pins, appr. 53 mm x 21mm x 8 mm Weight appr. 90g Pin pitch 2.54mm Number of pins (two rows) Distance between rows 15.24mm Ports Max. adimissable current from digital ports ±...
Page 32
C-Control Pro Mega Series 74HC165 holds only 8 Bit information, Q7 of the 1st 74HC165 is connected with DS of the 2nd 74HC165. I2C Interface Through this interface serial data can be transmitted at high speed. To do this only two signal lines are necessary.
C-Control Pro Mega Series Environmental Conditions Range of admissible ambient temperature 0°C … 70°C Range of admissible relative ambient humidity 20% … 60% Power Supply 8V … 24V Range of admissibly operating voltage Power consumption without external loads appr. 125mA Max.
Page 36
C-Control Pro Mega Series Jumperpositions at delivery JP4 serves to toggle the operating voltage (Mains Plug-In Power Supply or USB). The application board should be operated using Plug-In Power Supply and voltage control (Shipping Condition). The maximum current to be drawn from the USB interface is lower than from the Plug-In Power Supply.
C-Control Pro Mega Series Mega128 The Micro Controller Atmega128 originates from the AVR family by ATMEL. It is a low-power Micro Controller with Advanced RISC Architecture. In the following see a short summary of its hardware resources: · 133 Powerful Instructions – Most Single Clock Cycle Execution ·...
Page 44
C-Control Pro Mega Series Note: Detailed information can be found in the IC manufacturer’s PDF files on the C-Control Pro Software CD-ROM. ADC Reference Voltage Generation The Micro Controller is equipped with an analog-to-digital converter with a 10 Bit resolution. This means that measured voltages can be represented by integral numbers from 0 through 1023.
C-Control Pro Mega Series Clock Clock Frequency (Quartz Oscillator) 14.7456MHz Mechanics Overall measurements less pins, appr. 40 mm x 40mm x 8 mm Weight appr. 90g Pin pitch 2.54mm Number of pins (two rows) Ports Max. admissible current from digital ports ±...
Page 48
C-Control Pro Mega Series 74HC165. SRAM The application board holds an SRAM chip (K6X1008C2D) made by Samsung. By using this the available SRAM memory is extended to 64kByte. Mentioned SRAM uses Ports A, C and partly G for triggering. If the SRAM is not used then it can be de-activated by JP7 and then these ports become available to the user.
C-Control Pro Mega Series Range of admissibly operating voltage 8V … 24V Power consumption without external loads appr. 125mA Max. admissibly permanent current from a 200mA stabilized 5V power supply 3.4.3 Pin Assignment PortA through PortG are for direct pin functions (e. g. Port_WriteBit) counted from 0 through 52, see "PortBit".
Page 52
C-Control Pro Mega Series Jumperpositionen im Auslieferzustand Ports A through G The ports available with the Mega128 Module are inscribed in this graph. Here the yellow side is connected to the module while the light blue side connects to the components of the application board.
C-Control Pro Mega Series Projects Every program for the C-Control Pro Module is configured through a project. The project states which source files and libraries are being utilized. Also the settings of the Compiler are noted. A project consists of the project file with the extension ".cprj" and the appropriate source files.
C-Control Pro Mega Series Project Files When files have been added to the project these can be opened by a double mouse click onto the file name. By use of a right click further options will appear: · – The project file will move up the list (also with Ctrl - Arrow up).
C-Control Pro Mega Series 4.1.5 Project Options For each project the compiler settings can be changed separately. The items Author, Version, Commentary can be freely inscribed. They serve as memory support in order to better remember the project details at a later date.
C-Control Pro Mega Series Editor Several windows can be opened in the C-Control Pro Interface. Each window can be altered in size and displayed text detail. A double mouse click on the title line will maximize the window. A mouse click in the area to the left of the text will there set a Breakpoint. Prior to this the source text must be compiled error free with "Debug Info"...
C-Control Pro Mega Series To fold or unfold all functions in an editor file, the options Full Collapse Full Expand selectable in the right click editor pull-up menu. Syntactical Input Help The editor now has a syntactical input help. When the beginning of a reserved word or a function name from the standard library is typed into the editor, the input help can be activated with Ctrl- Space.
C-Control Pro Mega Series 4.2.3 Keyboard Shortcuts Taste Funktion Left Move cursor left one char Right Move cursor right one char Move cursor up one line Down Move cursor down one line Ctrl + Left Move cursor left one word...
C-Control Pro Mega Series Reset selection Ctrl + digit (0-9) Go to Bookmark digit (0-9) Shift + Ctrl + (0-9) Set Bookmark digit (0-9) Ctrl + Space Auto completion popup 4.2.4 Regular Expressions The search function in the editor supports Regular Expressions. With this function character chains can highly flexible be searched for and replaced.
C-Control Pro Mega Series 4.3.2 Outputs For display of Debug messages there is an "Outputs" window section. Here is shown when the Bytecode Interpreter has been started and terminated and for how long (in milliseconds) the Interpreter was in operation. The operation time however is not very useful if the Interpreter has been stopped during Debug Mode.
4.3.4 Version Check Since the C-Control Pro Mega Series supports various hardware platforms it is important to closely monitor the current version numbers of Bootloader, Interpreter and Hardware. This is possible by use of item Hardware Version in the C-Control menu.
C-Control Pro Mega Series If in Debug Mode, the next Breakpoint will be reached by use of Start (F10). If no Breakpoint is set then the programm will be executed in its normal way. There is the exception however that the...
C-Control Pro Mega Series The contents of an array window may at every stop of the Debugger or at every single step no longer be actual. If with each single step in the Debugger several array windows are newly brought up-to- date then delays may occur since the data must always be loaded from the Module.
C-Control Pro Mega Series Variables of the Character type are displayed as single ASCII characters. Tools Terminal Window In the Tools pulldown menu a simple terminal program can be started. Received characters are directly shown in the terminal window. Characters can be send in two different ways.
C-Control Pro Mega Series Double click line - Highlights the line when you double-click any character in the line. If disabled, only the selected word is highlighted. Fixed line height - Prevents line height calculation. Line height will be calculated by means of Default Style.
C-Control Pro Mega Series Library: function names of the standard library Default, Line separator Sub background are not used. 4.6.3 Compiler Presetting In the Compiler Presetting the standard values can be configured which will be stored during creation of a new project. Presetting can be reached under Compiler in the Options menu.
Page 86
C-Control Pro Mega Series 4.6.4.1 Interfaces Through a selection box the connection to the application board can be set. USB connections will start with the prefix "USB" and will then be successively numbered: USB0, USB1, ... Serial interfaces will be handled equally. They will start with the prefix "COM": COM0, COM1, ..., aso.
Page 87
4.6.4.2 Internet Update In order to check if any improvements or error corrections have been issued by Conrad Electronic the Internet Update can be activated. When the selection box "Update Check Every Days" is selected then an update will be searched for in the Internet at an interval of days at every start of the IDE.
Page 88
C-Control Pro Mega Series 4.6.4.3 Terminal Here you can set the serial parameter for the built in terminal program. For the Port entry an available serial COM Port can be chosen from. Further the standard baudrates, the number of Data...
"Version Information" and will at the same time copy the contents onto the clipboard. These informations are important if a Support E-Mail needs to be sent to Conrad Electronic. Since these informations are automatically placed onto the clipboard when...
Page 94
C-Control Pro Mega Series Conditional Compiling #ifdef symbol #else // optional #endif It is possible to monitor which parts of the source texts are really being compiled. After a #ifdef symbol instruction the following text is only compiled when symbol...
C-Control Pro Mega Series Global Variable Length Position (RAM Start) --------------------------------------------------------------- Total Length: bytes Local Variable Length Position (Stack relative) ----------------------------------------------------------------- Function Pulse() count Total Length: bytes Function main() count Total Length: bytes From this list can be seen that no global variables are being used. There are further the two functions "Pulse()"...
Page 98
C-Control Pro Mega Series · Multi line commentaries start with "/*" and end up with "*/". /* a multi line commentary */ // a single line commentary Identifier Identifier are the names of Functions Variables · Valid characters are letters (A-Z,a-z), numbers (0-9) and the low dash ('_') ·...
C-Control Pro Mega Series · If in a linkage of 8 Bit or 16 Bit integer values one of the two data types is sign afflicted ("signed") then the result of the expression is also sign afflicted. I. e. the operation is executed "signed".
Page 102
C-Control Pro Mega Series As an exception char arrays may have character strings assigned to. Here the character string is placed between quotation marks. str1="hallo world!"; Strings cannot be assigned to multi dimensional Char arrays. There are however tricks for advanced users: char str_array[3][40];...
Page 104
C-Control Pro Mega Series Multiplication 5 * 4 Division 7 / 2 7.0 / 2 Modulo 15 % 4 17 % 2 Negative Sign -(2+2) 5.2.5.2 Bit Operators Bit operators are only allowed for Integer data types Operator Description Example Result &...
C-Control Pro Mega Series 5.2.6 Control Structures Control structures allow to change the program completion depending on expressions, variables or external influences. 5.2.6.1 Conditional Valuation With a conditional valuation expressions can be generated which will be conditionally calculated. The form is:...
Page 108
C-Control Pro Mega Series break Instruction A break instruction will leave the loop and the program execution starts with the next instruction after the for loop. continue Instruction continue will immediately initialize a new calculation of the Expression. Depending on the result Instruction2 will be executed at unequal and the loop will repeat itself.
Page 110
C-Control Pro Mega Series corresponding to the value of the Expression and will continue the program from there. If no constant corresponds to the value of the expression the switch construct will be left. If a default is defined within a switch instruction then the instructions after default will be executed if no constant corresponding to the value of the instruction has been found.
Page 112
C-Control Pro Mega Series void main(void) // function func1 will be called up twice func1(); func1(); Parameter Passing In order to enable functions to be flexibly used they can be set up parametric. To do this the parameters for the function are separated by commas and passed in parenthesis after the function name.
C-Control Pro Mega Series BASIC The second programming language for the C-Control Pro Mega Module is BASIC. The Compiler translates the BASIC commands into a Bytecode which is then processed by the C-Control Pro Interpreter. The language volume of the BASIC dialect used here corresponds to a large extent to the industry standard of the large software suppliers.
Page 118
C-Control Pro Mega Series · The length of an identifier is unlimited Arithmetic Expressions An arithmetic expression is a quantity of values connected by Operators. In this case quantities can either be Figures, Variables Functions A simple example: Here the numerical values are connected by the Operator "+".
Page 120
C-Control Pro Mega Series As types are allowed: Char, Byte, Integer, Word, Single Examples: Dim a As Integer Dim i,j As Integer Dim xyz As Single Integer variables may have decimal figure values or Hex values assigned to. With Hex values the characters "&H"...
Page 122
C-Control Pro Mega Series Visibility of Variables When variables are declared outside of functions then they will have global visibility. I. e. they can be addressed from every function. Variable declarations within functions produce local variables. Local variables can only be reached within the function. An example:...
Page 124
C-Control Pro Mega Series &H0f And 3 &Hf0 And &H0f 1 Or 3 &Hf0 Or &H0f &Hff exclusive Or &Hff Xor &H0f &Hf0 &Hf0 Xor &H0f &Hff Bit inversion Not &Hff Not &Hf0 &H0f 5.3.5.3 Bit-Shift Operators Bit-Shift operators are only allowed for Integer data types. With a Bit-Shift operation a will always be moved into one end.
Page 126
C-Control Pro Mega Series 5.3.6.2 Do While With a while instruction the instructions can depending on a condition be repeated in a loop: Do While Expression Instructions End While At first the Expression is evaluated. If the result is unequal then the expression is executed.
Page 128
C-Control Pro Mega Series a=a+1 a<10 Then Goto label1 End If End Sub 5.3.6.5 If .. Else An If instruction does have the following syntax: If Expression1 Then Instructions1 ElseIf Expression2 Then Instructions2 Else Instructions3 End If After the if instruction an Arithmetic Expression will follow.
C-Control Pro Mega Series Case &Hf b=b/c Case < 10 b=10 Case <= 10 b=11 Case 20 To 30 b=12 Case > 100 b=13 Case >= 100 b=14 Case <> 25 b=15 Else b=b+2 End Case In CompactC the instructions will be continued after a Case instruction until a break comes up or the switch instruction is left.
C-Control Pro Mega Series Do While str(i) i=i+1 ' Repeat character as long as unequal zero End While Return i End Sub Sub main() Dim Len As Integer Dim Text(15) As Char Text="hello world" Len=StringLength(Text) End Sub In main the reference of text is presented as parameters to the function StringLength. If in a function a normal parameter is changed then the change is not visible outside this function.
C-Control Pro Mega Series Analog-Comparator The Analog Comparator allows to compare two analog signals. The result of this comparison is returned as either "0" or "1". 6.3.1 AComp AComp Functions Example Syntax void AComp(byte mode); Sub AComp(mode As Byte); Description The Analog Comparator allows to compare two analog signals.
C-Control Pro Mega Series difference of one bit of the digitized measuring value corresponds to a voltage difference of 4mV, or: u = x * 0,004V Differential Inputs ADC22x10 Differential Inputs ADC2, ADC2, Gain 10 ; Offset Measurement ADC23x10 Differential Inputs ADC2, ADC3, Gain 10...
C-Control Pro Mega Series Description The function ADC_Set initializes the Analog-Digital converter. The reference voltage and the measurement channel number is selected and the A/D converter is prepared for usage. After the measurement the value is read with ADC_Read(). Parameter (Port A.0 to A.7 at Mega32, Port F.0 to F.7 at Mega128)
Page 144
C-Control Pro Mega Series Parity Hour 36 - 41 Day of the Month 42 - 44 Weekday 45 - 49 Month 50 - 57 Year Parity Date This signifies that reception must be in progress for at least one full minute before time information can be provided.
C-Control Pro Mega Series Syntax void DCF_PULS(void); Sub DCF_PULS() Description ") DCF_Mode to 1 ("look for pulse Parameter None 6.5.4 DCF_START DCF Functions Syntax void DCF_START(void); Sub DCF_START() Description DCF_Mode to 1. From now on DCF time recording is DCF_START initializes all variables and sets working automatically.
C-Control Pro Mega Series Parameter val float value 6.6.3 Msg_WriteHex Debug Message Functions Syntax void Msg_WriteHex(word val); Sub Msg_WriteHex(val As Word) Description The 16bit value is displayed in the output window. The Output is formatted as a hexadecimal value with 4 digits.
C-Control Pro Mega Series byte EEPROM_Read(word pos); Sub EEPROM_Read(pos As Word) As Byte Description Reads one byte out of the EEPROM at position pos. The first 32 byte are reserved for the OS of C-Control Pro. Therefore a pos value of 0 and higher accesses the EEPROM memory at position 32 and upwards.
C-Control Pro Mega Series Description Writes one word into the EEPROM at position pos. The first 32 byte are reserved for the OS of C-Control Pro. Therefore a pos value of 0 and higher accesses the EEPROM memory at position 32 and upwards.
C-Control Pro Mega Series Return Parameter value read from the I2C bus 6.8.4 I2C_Start I2C Functions Example Syntax void I2C_Start(void); Sub I2C_Start() Description This function introduces communication with a starting sequence. Afterwards the status of the interface can be returned with I2C_Status().
C-Control Pro Mega Series 6.8.8 I2C Status Codes Table: Status Codes Master Transmitter Mode Status Code Description 0x08 a START sequence has been sent 0x10 a "repeated" START sequence has been sent 0x18 SLA+W has been sent, ACK has been received...
C-Control Pro Mega Series specifies the interrupt type (see table) irqnr Return Parameter The return value expresses how often a interrupt got triggered until the function Irq_GetCount() has been called. A value greater 1 shows that the interrupts are triggered more rapidly than the interrupt service routine is processed.
C-Control Pro Mega Series with 16 bits. Bits that are set represent keys that have been pressed during the scan. Return Parameter 16 bits that represent the input lines of the keyboard 6.10.3 Key_TranslateKey Keyboard Functions (Library "Key_Lib.cc") Syntax char Key_TranslateKey(word keys);...
C-Control Pro Mega Series 6.11.4 LCD_CursorPos LCD Functions (Library "LCD_Lib.cc") Syntax void LCD_CursorPos(byte pos); Sub LCD_CursorPos(pos As Byte) Description Moves the cursor to position pos. Parameter cursorposition Value of pos Position on Display 0x00-0x07 0-7 in der 1. Zeile 0x40-0x47 0-7 in der 2.
C-Control Pro Mega Series void LCD_TestBusy(void); Sub LCD_TestBusy() Description This function waits for a non-busy of the display controller. If the controller is accessed in his busy period the output data will be corrupted. Parameter None 6.11.9 LCD_WriteChar LCD Functions (Library "LCD_Lib.cc")
C-Control Pro Mega Series Sub LCD_WriteRegister(y As Byte,x As Byte) Description LCD_WriteRegister divides the data byte y in 2 nibbles (4bit values) and sends the nibbles to the display controller. y data byte x command nibble 6.11.14 LCD_WriteText LCD Functions (Library "LCD_Lib.cc")
C-Control Pro Mega Series arc sine of the input value in the range [-Pi/2..Pi/2], expressed in radians 6.12.3 atan Mathematical Functions Syntax float atan(float val); Sub atan(val As Single) As Single Description The mathematical arc tangent (inverse tangent) is calculated.
C-Control Pro Mega Series Sub fabs(val As Single) As Single Description The absolute value of the floating point number val is calculated. Parameter val input value Return Parameter result 6.12.8 floor Mathematical Functions Syntax float floor(float val); Sub floor(val As Single) As Single...
C-Control Pro Mega Series Return Parameter result 6.12.12 pow Mathematical Functions Syntax float pow(float x,float y); Sub pow(x As Single,y As Single) As Single Description The power function x ^ y is calculated. Parameter x base y exponent Return Parameter result 6.12.13 sin...
C-Control Pro Mega Series When there is no communication, the signal wire has a +5V level and charges a capacitor. During low-pulse communication the slave device is powered from his capacitor. Dependent on the charge of the capacitor, low-time gaps up to 960 µs can be bridged.
C-Control Pro Mega Series 6.14.1 Port_DataDir Port Functions Example Syntax void Port_DataDir(byte port,byte val); Sub Port_DataDir(port As Byte,val As Byte) Description The function Port_DataDir configures the port for input or output direction. Is a bit set, then the Pin corresponding to the bit position is switched to output. Example: Is port = PortB and val = 0x02, then PortB.1 is configured for output, all other ports on PortB are set to input (...
C-Control Pro Mega Series Parameter port port number (see table) Return Parameter port byte value port number table Definition Value PortA PortB PortC PortD PortE (Mega128) PortF (Mega128) PortG (Mega128) 6.14.4 Port_ReadBit Port Functions Syntax byte Port_ReadBit(byte port); Sub Port_ReadBit(port As Byte) As Byte Description The function Port_ReadBit reads the value of a Pin that is configured for input.
C-Control Pro Mega Series PortC PortD PortE (Mega128) PortF (Mega128) PortG (Mega128) 6.14.6 Port_WriteBit Port Functions Syntax void Port_WriteBit(byte portbit,byte val); Sub Port_WriteBit(portbit As Byte,val As Byte) Description Is a Pin configured as The function Port_WriteBit sets the value of a Pin that is configured for output.
C-Control Pro Mega Series divider = (14745600 / baudrate / 16 ) -1 Example: 15 = (14745600 / 57600 / 16 ) -1 DoubleClock Mode If the High-Bit of the divider is set, the DoubleClock Mode is enabled. In this mode the divider value must be doubled.
C-Control Pro Mega Series 6.15.4 Serial_Init_IRQ Serial Functions Example Syntax void Serial_Init_IRQ(byte serport,byte ramaddr[],byte recvlen,byte sendlen,byte par Sub Serial_Init_IRQ(serport As Byte,ByRef ramaddr As Byte,recvlen As Byte,sendlen A par As Byte,div As Byte) Description The serial interface gets initialized for usage in interrupt mode. The user has to provide a global variable as a serial buffer.
C-Control Pro Mega Series waits until a byte has been received. Please use Serial_ReadExt() if you work in serial IRQ mode. Serial_Read() only supports polled mode. Parameter serport interface number (0 = 1st serial port, 1 = 2nd serial port )
C-Control Pro Mega Series int i; char str[10]; str="test"; i=0; // initialize serial port with 19200baud, 8 bit, 1 stop bit, no parity // 20 byte receive buffer - 15 byte send buffer Serial_Init_IRQ(0,buffer,20,15,SR_8BIT|SR_1STOP|SR_NO_PAR,SR_BD19200); while(str[i]) Serial_Write(0,str[i++]); // display string 6.16 Presently the SPI interface is used on the Applicationboard to receive USB data from the Mega8 controller.
C-Control Pro Mega Series pointer to destination string destination source pointer to source string offset Number of characters by which the source string is offset when copied to the destination string.. If offset has the value STR_APPEND (0xffff) then the length of the destination string is assumed as offset.
C-Control Pro Mega Series 6.17.7 Str_Substr String Functions (Library "String_Lib.cc") Syntax int Str_SubStr(char source[],char search[]); Sub Str_SubStr(ByRef source As Char,ByRef search As Char) As Integer Description A substring search is searched inside string source. If the substring is found, the position of the substring is returned.
C-Control Pro Mega Series 16 bit word base base of the number system text pointer to destination string offset offset that is applied to the position where the string is copied minwidth minimal width of the string If offset has the value STR_APPEND (0xffff) then the length of the destination string is assumed as offset.
C-Control Pro Mega Series 6.18.2 Thread_Delay Thread Functions Example Syntax void Thread_Delay(word delay); Sub Thread_Delay(delay As Word) Description With this function a thread will set to "sleep" for a specified time. After this time the thread is again ready for execution.
C-Control Pro Mega Series 6.18.6 Thread_MemFree Thread Functions Syntax word Thread_MemFree(void); Sub Thread_MemFree() As Word Description Returns the free memory that is available for the calling thread. Parameter None Return Parameter free memory in bytes 6.18.7 Thread_Resume Thread Functions Syntax void Thread_Resume(byte thread);...
C-Control Pro Mega Series Description The thread gets the state "waiting". The state can be changed back to "inactive" with calls to Thread_Resume() or Thread_Signal(). Parameter thread (0-13) thread number signal signal value 6.18.11 Thread Example // demo program of multithreading...
C-Control Pro Mega Series With Mega128 for reasons of the hardware the use of Timer_0 as counter is not possible! Timer1 (16 Bit) // Example: Pulse Counting with CNT1 Timer_T1CNT(); pulse(n); // generate n Pulses count=Timer_T1GetCNT(); 6.19.2 Frequency Generation To generate frequencies Timer_0, Timer_1 and Timer_3 can be utilized as follows: Timer0 (8 Bit) 1.
C-Control Pro Mega Series be entered into the measuring result. With a programmable prescaler the resolution of Timer_1 can be set. Prescaler see Table Example: Activate Pulse Width Measurement (Project PMeasurement) 434 µs (100 x 4,34 µs, see Table word PM_Value;...
C-Control Pro Mega Series Description These function initializes Counter0. Counter0 gets incremented at every positive signal edge at Input Mega32:T0 (PIN1). Due to hardware reasons it is not possible to use Timer_0 as a counter in the Mega128! Parameter None 6.19.9 Timer_T0FRQ...
C-Control Pro Mega Series 6.19.12 Timer_T0PWM Timer Functions Syntax void Timer_T0PWM(byte PW,byte PS); Sub Timer_T0PWM(PW As Byte,PS As Byte) Description This function initializes Timer0 with given prescaler and pulse width, see table. The output signal is generated at Mega32: PortB.3 (PIN4), Mega128: PortB.4 (X1_4). There is an extended prescaler definition for the Mega128, see table.
C-Control Pro Mega Series Time time period after that the interrupt is triggered prescaler Table prescaler: Mega32 Prescaler Time Base (duration of a tick) PS0_1 (1) 67,8 ns PS0_8 (2) 542,5 ns PS0_64 (3) 4,34 µs PS0_256 (4) 17,36 µs PS0_1024 (5) 69,44 µs...
C-Control Pro Mega Series 6.19.23 Timer_T1PM Timer Functions Syntax void Timer_T1PM(byte Mode,byte PS); void Timer_T1PM(Mode As Byte,PS As Byte) Description pulse width measurement or period measurement should be done. This function defines if Then it initializes Timer_1 and sets the prescaler.
C-Control Pro Mega Series void Timer_T1Time(word Time,byte PS); Sub Timer_T1Time(Time As Word,PS As Byte) Description This function initializes Timer_1 with a prescaler and a timer interval value (16bit), see table. After the timing interval is expired Timer_1 Interrupt (INT_TIM1CMPA) is triggered. There is an extended prescaler definition for the Mega128, see table.
C-Control Pro Mega Series 6.19.38 Timer_T3PM Timer Functions Syntax void Timer_T3PM(byte Mode,byte PS); void Timer_T3PM(Mode As Byte,PS As Byte) Description pulse width measurement or period measurement should be done. This function defines if Then it initializes Timer_3 and sets the prescaler.
C-Control Pro Mega Series output signal is generated at PortE.3 (X1_13) and PortE.4 (X1_12). Parameter period period duration pulse width channel A pulse width channel B prescaler (see table prescaler) 6.19.42 Timer_T3PWMY Timer Functions Syntax void Timer_T3PWMY(word period,word PW0,word PW1,word PW2,byte PS);...
C-Control Pro Mega Series Problems 1. No USB connection existing to the Application Board. · Has the FTDI USB driver been loaded onto the PC? Or does “Unknown Device” appear in the Hardware Manager, when the USB connector is plugged in? ·...
Page 234
C-Control Pro Mega Series · Take a look at the Pin Assignment of and M128. You can use all ports that have no special functionality ( SPI, RS232, LCD, Keyboard etc.) that is needed for your application. Do not forget to remove the jumper that connects the port pins to the application board.
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