Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello!

I'm trying to code the I2C communication part for the camera ov7670 and when I try to assign the output pins to SCL and SDA, DAVE tells me that no pins are available.
Also when I try to generate code it informs me that it could not be geerated due to a fault in the i2c_master.confc.tmpl file (218),
int temp_inpr_inp  = (i2cInst.hwres_usic_channel.getRegValue("1","inpr_tsinp") << 0) +
(i2cInst.hwres_usic_channel.getRegValue("1","inpr_tbinp") << 4) +
(i2cInst.hwres_usic_channel.getRegValue("1","inpr_rinp") << 😎 +
(i2cInst.hwres_usic_channel.getRegValue("1","inpr_ainp") << 12) +
(i2cInst.hwres_usic_channel.getRegValue("1","inpr_pinp") << 16)

(Cannot incoke method leftShift() on a Null object), but i guess it's due to the lack of output pins

thanks!
0 Likes
6 Replies
DRubeša
Employee
Employee
First solution authored First like received
Hi hfegetude,

can you please tell me which board are you using and which pins are you trying to allocate as a output pins. I will try to replicate your issue and provide you with a feedback.

Best regards,
Deni
0 Likes
Not applicable
Hi,
I'm using a XMC 4500 Relax Lite,
thanks
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi,

I asked you in my last posted also which output pins are you try to use for I2C, but OK...I will provide you with more general answer then 🙂

The microcontroller that you´re using has many available pins to be used for I2C protocol. This picture is taken from XMC Pinout Tool and it shows the available pins for each USIC channel.
2289.attach

(Disregard channel U1C1 while there is not available SDA pin so you cannot assign pins inside DAVE for channel U1C1...but you can still use 5 other channels so no biggie 😄 )

All the pins that you can see in the attached picture are available from the microcontroller´s point of view, but not all the pins are connected to the board pin header. The available pins from the board´s point of view are given in "Board User's Manual "XMC4500 Relax / Relax Lite Kit"". There you can see something like this:
2288.attach

And now in the DAVE, you should be able to select any of the pins mentioned in previous two figures (even though if you´re going to connect something to the board´s pin headers then it make sense only to select the pins given in the second figure).

Under "DAVE" -> "Manual Pin Allocator", you will see something like this:
2290.attach

Now just assign the one of the pins given in the second figure (namely pins P.5.2, P.10, P0.11 as a SCL, or P5.0, P1.5, P0.5 as a SDA pins) and DAVE will automatically offer you pin from the same USIC channel.

I´ve wrote such a detailed description, while I can select any of these pins and DAVE doesn´t give me any error regarding template like in your case. Let me know have you successfully build your project or tell me at least which pins are you trying to use to connect to the camera module. Currently, such a general advice is the best I can do.

Regards,
Deni
0 Likes
Not applicable
Hey thanks for the response!
It's not the I want to use any pins in particular, so far I was trying to use the USIC0_C0 ones.
I think I went a little bit deeper on the problem realising I didn't "install" the I2C config app, in any case these app is giving me problems.
2297.attach
And wen I click on them, the porgram redirects me to:
2298.attach
In which I think both the Tx and Rx FIFO pointers need to be changed, but the program is not leeting me.
I also attach a screenchot of my current pin allocator view:
2299.attach
Best regards!
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
HI,

so several things caught my eye...You don´t need to use I2C_CONFIG APP. I2C_MASTER APP is perfectly suited for your purpose. As a matter of fact I advise you to not use both APPs at once. So, use I2C_MASTER APP for your project (it doesn´t have all the bells and whistles of the CONFIG APP, but that also means it´s simpler to use). Another thing is that the selected microcontroller core is wrong. As you mentioned in your previous post, you´re using XMC4500 Relax Lite Kit. You can see the markings on the chip cover but the microcontroller used is one with LQFP100 packaging...not 144 pin package that I see in your screenshot. Also that last figure in your previous post is confusing me while it looks like no pin is connected (NC meaning not connected). You can see in my previous post that my Pin Mapping window showed all pins as available.

For all of these reasons, let´s try to do something just to see if you get the simple project running. Can you please make a new project ("File"->"New"->"DAVE project") and then as a project type select DAVE CE project (very important step !!!).
2301.attach

Now select the microcontroller under "Microcontrollers"->"XMC4000"->"XMC4500 series"->"XMC4500-F100x1024" and press "Finish".

Add I2C_MASTER APP and try to assign pins in Pin Mapping window. Let me know have you been successful in assigning the pins.

Best regards,
Deni
0 Likes
Not applicable
Done!
2302.attach
The thing goes smooth now!
Thank very much 😄
Best regards!
Luis
0 Likes