Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 1 month ago.
Portin data for OV7670
Hi fellow mbed community, after reading through the code used to initialise the pins for D7-D0 at main.h (http://developer.mbed.org/users/edodm85/code/OV7670_Test_Code_with_ethernet/file/df8de18d7fa9/main.h),
would like to know how do you know the the pin numbers to be Port0,0x07878000, to be the p18(P0.26),p17(P0.25),p16(P0.24),p15(P0.23),p11(P0.18),p12(P0.17),p14(P0.16),p13(P0.15, I'm trying to do the same for Kl25Z, would like to know if there's a way to find out what hex code for pins that I wish to declare?
from PortName port, 8bit bus port int mask, 0b0000_0M65_4000_0321_L000_0000_0000_0000 = 0x07878000
Question relating to:
7 months ago.
It seems like the Mask is written in Hexadecimal: 0x07878000
However the Mask is actually working in binary, which is below, counting the binary from right to left:
- 00000111 10000111 10000000 00000000
which are 26, 25, 24, 23, 18, 17, 16, 15
PortIn p(Port0, 0x07878000) >>>>> P0_26, P0_25, P0_24, P0_23, P0_18, P0_17, P0_16, P0_15
And another example is from the awful MBED _APIS: https://os.mbed.com/docs/mbed-os/v5.13/apis/portin.html
PortIn p(Port2, 0x0000003F)
0x0000003F to Binary >>>> 00111111
PortIn p(Port2, 0x0000003F) >>>> P2_5, P2_4, P2_3, P2_2, P2_1, P2_0