Solved! Go to Solution.
We are aware of this issue and it will be fixed it in the next release of ProcessorExpert.
The following steps can be used to workaround the problem:
- Configure all properties of the the ADC bean as you need (without the channel 29 for now)
- Click on the 'Add channel' to add one more channel, select any unused pin (the best would be the PTA0_... if you haven't already used it)
- Generate the code using the menu command Processor Expert / Generate Code '...'
- Disable the generation for the ADC bean (click on the bean with right button and select Code Genearation / Don't write generated bean module
- Open the generated module of the ADC bean {bean_name}.c - probably ADC1.c and find the line that looks like
static const byte Channels[2] = {0x47,0x40}; /* Contents for the devicecontrol register */
The number of channels and values may be different depending on what have youset.
- Change the last value in the way that the lower 5 bits of this value will be the channel number = 29. In our example it will be 0x40 + (29 to hex) = 0x5D.
static const byte Channels[2] = {0x47,0x5D}; /* Contents for the devicecontrol register */
and save the file.
- Compile the project and the channel 29 will be measured as the last channel instead of what is configured in the instpector.
Please note that the changes in ADC bean instpector won't affect the codefrom now, because the code won't be re-generated for the ADC bean.
Best Regards
Vojtech Filip
Processor Expert Support Team
We are aware of this issue and it will be fixed it in the next release of ProcessorExpert.
The following steps can be used to workaround the problem:
- Configure all properties of the the ADC bean as you need (without the channel 29 for now)
- Click on the 'Add channel' to add one more channel, select any unused pin (the best would be the PTA0_... if you haven't already used it)
- Generate the code using the menu command Processor Expert / Generate Code '...'
- Disable the generation for the ADC bean (click on the bean with right button and select Code Genearation / Don't write generated bean module
- Open the generated module of the ADC bean {bean_name}.c - probably ADC1.c and find the line that looks like
static const byte Channels[2] = {0x47,0x40}; /* Contents for the devicecontrol register */
The number of channels and values may be different depending on what have youset.
- Change the last value in the way that the lower 5 bits of this value will be the channel number = 29. In our example it will be 0x40 + (29 to hex) = 0x5D.
static const byte Channels[2] = {0x47,0x5D}; /* Contents for the devicecontrol register */
and save the file.
- Compile the project and the channel 29 will be measured as the last channel instead of what is configured in the instpector.
Please note that the changes in ADC bean instpector won't affect the codefrom now, because the code won't be re-generated for the ADC bean.
Best Regards
Vojtech Filip
Processor Expert Support Team