|
Post by crazydoc on Apr 13, 2021 8:22:09 GMT
Hello,
I am a complete Shield Buddy newbie. I would like to control a simple 20x4 LCD display with I2C. Unfortunately, it seems that this does not work as easily as I thought. When I run the demo sketch on the buddy via the Arduinio IDE, the reset led is permanently lit. The display is connected to the pins (20/21). Does anyone have an idea or maybe even a working library (Like LiquidCrystal_I2C)?
Thanks a lot!
|
|
|
Post by Admin on Apr 13, 2021 8:35:07 GMT
|
|
|
Post by crazydoc on Apr 13, 2021 9:12:04 GMT
Thanks a lot! I have tried the libraries, but after the installation and a reset, the reset LED is still permanently and the display makes no movement.
If I comment out lcd.begin(), at least the reset LED goes out. Unfortunately, this does not help me.
|
|
|
Post by crazydoc on Apr 13, 2021 11:45:34 GMT
Is there perhaps a small sample code for this? The compiler is satisfied, but something is interfering with the buddy on the I2C LCD.
|
|
|
Post by Admin on Apr 13, 2021 12:36:14 GMT
Here is an example using pins 20 & 21. LcdI2c.ino (2.05 KB)
|
|
|
Post by crazydoc on Apr 13, 2021 15:41:43 GMT
Thanks! I have tried. It can be compiled and flashed on the buddy. However, after the reset (so that the programme is executed), the reset led lights up again. It seems that the problem is related to the Wire.h library. The Buddy hangs on every call concerning LCD and Wire.I also tried to flash the Main_i2C example. That gives the same picture. I'm slowly running out of ideas.
Is it normal that the red LEDs are permanently lit when the buddy is supplied? Couldn't find anything about them in the docu.
Attachments:
|
|
|
Post by Admin on Apr 14, 2021 9:19:37 GMT
|
|
|
Post by Admin on Apr 14, 2021 9:21:15 GMT
Yes the two red LEDs are normally lit. These are the SSx pins on the TLF35584. They are only relevant if the TLF35584 safety monitor is active, which by default it is not!
|
|
|
Post by crazydoc on Apr 15, 2021 9:38:34 GMT
Hey, thanks a lot. I am depressed  . Now I have completely uninstalled all software components (Arduino IDE, Shieldbuddy etc..) again, reloaded everything according to the instructions or taken ShieldBuddyTC375IDE.zip from the link and reinstalled it again. Unfortunately, the same error pattern again. As soon as the library "Wire.h" is needed in a program (e.g. Lcd.beginn() etc.) the reset led lights up permanently and the ShieldBuddy refuses to work. Also with the example "Main_i2C". If I comment out the lines of the calls, everything works. Something must be wrong with the I2C so that the Buddy hangs when called. Is it possible to check the basic I2C function with the Eclipse IDE or another program to rule out a hardware error? The EOL test finds the Buddy to be working.
|
|
|
Post by Admin on Apr 15, 2021 10:44:55 GMT
Please check that C:\Program Files (x86)\Arduino\hardware\ShieldBuddyTC375\aurix\variants\tc375\system_tc37x.c contains this:
/* Fcpu=300/Fsys=100 MHz @ 20MHz ext. clock */ static const PllInitValue_t g_PllInitValue_300_100 = { /* OSCCON, SYSPLLCON0, SYSPLLCON1, CCUCON0, CCUCON1, CCUCON2, finalK, PERPLLCON0, PERPLLCON1 */ 0x0005001C, 0x41057600, 0x00000005, 0x17230133, 0x21120213, 0x00001201, 1, 0x00053E00, 0x00000101 };
The CCUCON1 = 0x21120213 is critical.
|
|
|
Post by crazydoc on Apr 15, 2021 11:08:57 GMT
/* Fcpu=300/Fsys=100 MHz @ 20MHz ext. clock */ static const PllInitValue_t g_PllInitValue_300_100 = { /* OSCCON, SYSPLLCON0, SYSPLLCON1, CCUCON0, CCUCON1, CCUCON2, finalK, PERPLLCON0, PERPLLCON1 */ 0x0005001C, 0x41057600, 0x00000005, 0x17230133, 0x21120013, 0x00001201, 1, 0x00053E00, 0x00000101 };
It looks like the same as in your's
|
|
|
Post by crazydoc on Apr 16, 2021 4:25:22 GMT
Yesterday I changed the calls from Wire.h to SoftwareWire.h in the Liquid Crystal library and assigned pins 6 and 7. After that, the code could be compiled/flashed to the Buddy and executed. Unfortunately I haven't managed to show anything on the display yet, but at least the Buddy doesn't freeze anymore and the reset led is switched off. According to the documentation, the baud rate cannot be changed when using SoftwareWire.h. Maybe the default 100kbit's are just too much for the HW-061? Any experience? In any case, it looks like the standard I2C ports (20/21) of the BuddyShield are defective. Is there any way to check this without an oscilloscope?
|
|
|
Post by Admin on Apr 16, 2021 8:51:52 GMT
This works on the Adafruit 20x4 I2C display. We will try it with some other I2C displays!
|
|
|
Post by crazydoc on Apr 16, 2021 12:31:08 GMT
Also with SoftwareWire.h ? If so, may I have the example + libraries for it? I can't explain why the hardware I2C pins don't work. As soon as they are supposed to start communicating, the buddy freezes and the red reset lights up permanently.
|
|
|
Post by Admin on Apr 16, 2021 12:39:16 GMT
The normal I2C driver in Wire.h works here with the GeekPI, Youline and Adafruit 20x4 I2C displays.
|
|