UM0935
Running the IBU UI tool
Doc ID 17398 Rev 3
17/53
3.1.2 GPIO
settings
For the GPIO which is to be used along with the I
2
C interface, it is necessary to make the
proper settings. These GPIOs may be used as control lines, chip select or status line, such
as interrupt line, or to generate a clock signal using the PWM feature available on one pin.
Therefore, you need to make the GPIOs settings accordingly.
To understand the modes that are supported by a particular pin, please refer to
.
By default, I2C_GPIO1 to I2C_GPIO6 are in input pull-up mode.
Here you can set only the GPIOs mentioned. I
2
C lines (SDA and SCL) and power lines are
fixed. To perform the settings of a GPIO, use the I
2
C DLL referring to the DLL help file
available.
Through selection, the GPIO can be set in different modes, as shown in
, such as
simple input mode, input with interrupt, and push-pull output mode. Also in the I
2
C interface,
there is an option in GPIO5 and GPIO6 to use this GPIO as the PWM clock signal and there
is an option in GPIO6 to use it as an ADC channel. Please refer to
.
3.1.3 Using
GPIOs
in PWM mode settings
As mentioned above, GPIO 5 and GPIO 6 can also additionally be set in PWM mode. To do
this, set GPIO5 or GPIO6 in PWM mode and provide the PWM frequency (maximum value
tested is around 10 MHz), and also the duty cycle to generate different kinds of clocks.
The frequency of the PWM clock generated can vary from 10 kHz to 10 MHz. The duty cycle
of the PWM clock can vary from 0 % to 100 %. Logic '0' is obtained with the duty cycle at 0
% and logic '1' is obtained with the duty cycle at 100 %. Please note that the PWM
generated on GPIO5 and GPIO6 shares the same frequency but can have different duty
cycles. Please refer to
3.1.4 Using
GPIOs
as ADC mode settings
As mentioned above, GPIO 6 can also additionally be set as analog channel input. For that
set the GPIO 6 in ADC mode and do the analog settings. Analog settings include ADC
sample time selection and ADC resolution. After that, specify the number of samples that
are required. Then Analog input can be provided on this pin and the set of the digital value
can be obtained. If the resolution set is 8 bit, one byte is obtained for every sample of the
ADC conversion. If the resolution set is 12 bit, two bytes are obtained for every sample of
the ADC conversion. ADC sample time selection values can be one of the following:
7.5 cycles, 13.5 cycles, 28.5 cycles, 41.5 cycles, 55.5 cycles, 71.5 cycles, or 239.5 cycles.
3.1.5 I
2
C read and write operation
Once the I
2
C settings have been made, it is possible to read the registers of the slave device
and write in the registers of the slave device. After every read and write operation, the user
can obtain information about the status of the communication.
To read/write in the register, select the register address length depending on the slave
device.
The I
2
C register address length can range from 0 to 4 bytes. Depending on the address
length given, the register address should be provided in hex format. For instance, if the
register address is 3 bytes, its value should be in the form 0x123.
Содержание STEVAL-PCC009V2
Страница 4: ...Contents UM0935 4 53 Doc ID 17398 Rev 3 Appendix D Tables and figures 50 Revision history 52...
Страница 42: ...UM0935 Schematics and BOM list Doc ID 17398 Rev 3 42 53 Figure 32 10 pin com interface V...
Страница 43: ...Schematics and BOM list UM0935 43 53 Doc ID 17398 Rev 3 Figure 33 30 pin com interface V...