GPxPUD register values in C2000 F28035 c28x_LedBlink_ert Simulink Example
조회 수: 11 (최근 30일)
이전 댓글 표시
F28035 simulink example file: "c28x_LedBlink_ert" After the program was loaded, I clicked on the "Open project in Code Composer Studio" in the simulink "Diagnostic Viewer". In the CCS watch window, I was going through the register values and had a few questions:
1) In the CCS watch window for "c28x_LedBlink_ert" "GPAPUD" by default has a value 0x00000FFF (pull up disabled for GPIOs 0 to 11, which are PWMs), similarly "GPBPUD" has a default value of 0x00000300 (pull up disabled for GPIO 40 & 41, again these are PWMs). However I can't seem to find the file that initializes the registers with the mentioned values, the only file initializing the "GPxPUD" register is in fact the "DSP280x_Gpio.c" file which initializes the pull ups using the following two lines:
GpioCtrlRegs.GPAPUD.all = 0x0000; GpioCtrlRegs.GPBPUD.all = 0x0000;
So there has to be another file overwriting these registers, could I be directed to that file/function?
2) The "c28x_LedBlink_ert" toggles the GPIO pins 31 & 34, so that means that those GPIOs should be set as outputs, again looking at the watch window I observe that "GPADIR" has a value of 0x80000000 (i.e. GPIO 31 = output) and "GPBDIR" has a value of 0x00000004 (i.e. GPIO 34 = output), so things are fine. However shouldn't the pull ups be disbaled since these are outputs? Shouldn't "GPAPUD" be 0x80000FFF and "GPBPUD" be 0x00000304?
Thanks in advance
댓글 수: 0
답변 (1개)
Antonin
2018년 9월 3일
Hi Alex,
We don't initialize the pull-up registers and the default values after reset are not uniform across the different registers. The value you see for GPAPUD (0x00000FFF) corresponds to the value after reset. Look at Figure 63 of the following document:
Figure 64 shows the GPBPUD and the value 0x00000300 is also the value after reset.
I would agree that once the pin is driven as an output, the pullup is just a waste, though not harmful.
You can initialize the pullup registers using the following custom code block:
We will consider removing pullup for outputs in future releases.
Thanks for your input.
Antonin.
댓글 수: 5
Antonin
2018년 9월 6일
Great work, You proved it!
I shared your investigation with the team here, everyone loves it. People also think that you are a great photographer and that we should gift you with a new USB cable to thank you for the work :-)
On a more serious note, TI mentions in the documentation of the F2837x devices that input pins should not be left floating, which probably explains why they enabled the pullup by default on most F28335 pins except the ones that are dedicated to be outputs (i.e. PWM). On new devices, they disabled all pullups by default, which probably prompted them to add the warning.
We will investigate a way to configure the pullup registers in our tools. In addition to allowing the user to set the pullup, we can detect how pins are used to automatically set the pullup.
Thanks,
Antonin.
PS: Yes, these are my videos
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!