Issue Converting C2000 F28379D Sample to F28335 - ADC Block Error

45 Views Asked by At

I recently downloaded a sample file for the C2000 F28379D from Texas Instruments and successfully viewed it (referred to as image1). I attempted to adapt this sample to work with the F28335 by changing all relevant blocks from F28379D to F28335. During this process, I encountered an error related to the initialization function ('InitFcn') of ADC Type 3-5 blocks within my model. Specifically, the error arises in two parts of my project:

  1. The first error occurs in the 'f28335_sixstep_controlBLDC/Hardware Init/Code Generation/Calculate ADC Offset /For Iterator Subsystem/ADC5' block with the callback string: validatePiccoloADC;
codertarget.registry.registerPiccoloADCBlocks(gcb);
The system reports: "Unrecognized field name 'ADCmodule2'."

image2

  1. The second error is encountered in 'f28335_sixstep_controlBLDC/Current Control/Sensor Driver Blocks/Sensor Driver Blocks (codegen)/Current Measurement/ADC3' block, also with the callback string:
validatePiccoloADC;                                
codertarget.registry.registerPiccoloADCBlocks(gcb);

This time, the error message indicates an "Unrecognized field name 'ADCmodule'." image3

I aim to simulate this project with an F28335 MCU. Could anyone provide guidance on resolving these errors to successfully convert and run the simulation for the F28335?

Thank you for your assistance.

1

There are 1 best solutions below

0
On

To port the code from one MCU to another, you will have to take into account two things regarding the hardware peripherals:

  1. The version of the peripheral (type). There might be some additional features, or some changes in the way to configure the peripheral.
  2. The number of instances of this peripheral present in the MCU.

In your specific case, both are an issue:

  1. The F28335 has a type 2 ADC (page 8 of the datasheet), not a type 3-5 like we see in the Simulink Screenshots.
  2. It seems there are not the same number of instances on each MCU. From the datasheets, the F28335 has only one ADC module, the F28379D has four.

You will have to adapt the simulink model too, not only the configuration of the blocks.