Instructions

237 C-Control Pro IDE
© 2013 Conrad Electronic
Sub ADC_Start()
Description
The built-in A / D converter starts to convert analog data.
Parameter
None
5.4.2.7 ADC Example
// program to read the measured data from two ADC pins
void main(void)
{
int result[2];
char str[40];
ADC_Disable();
ADC_SetInput(0, 2, ADC_GND, ADC_SHG_1); // activate ADC2 - Gain 1
ADC_SetInput(1, 5, ADC_GND, ADC_SHG_4); // activate ADC5 - Gain 4
//12Bit ADC,free running,1MHz sampling rate,reference 1V,offset 0
ADC_Enable(ADC_MODE_12BIT | ADC_MODE_FREE_RUN, 1000000, ADC_REF1V,
2, 0);
ADC_Start();
while(1)
{
ADC_GetValues(result, 2); // read values
Str_Printf(str, "adc2: %d\r", result[0]);
Msg_WriteText(str);
Str_Printf(str, "adc5: %d\r", result[1]);
Msg_WriteText(str);
AbsDelay(300);
}
}
5.5 CAN Bus
The CAN bus (Controller Area Network Data Sheet) is an asynchronous serial bus system and be-
longs to the field buses. It is internationally standardized in ISO 11898 and defines the Layer 1
(physical layer) and 2 (data security layer).
The CAN-bus was developed in 1983 from Bosch. Originally, the CAN-Bus was developed for the
automotive sector, because with increasing vehicle electronics the wiring harnesses got larger, and a
solution for weight and cost reduction had to be found. This successful and very safe approach is not