logo elektroda
logo elektroda
X
logo elektroda

Seeking Functional Examples for Running hd44780 Display via TWI (I2C) PCF8574T on XMEGA 128A1U

kamil1555 3579 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15319098
    kamil1555
    Level 11  
    Hello. I have dug a fairly large number of websites in search of a working example of running the display on the hd44780 driver through the TWI (I2C) interface (PCF8574T) on the xmega 128A1U and nothing specific. I have launched the display myself, but I want to use the TWI interface to reduce the number of pins, and I have a PCF8574T expander at hand. Does anyone have a library ready or can I indicate where I will find one? I will add that I program in ATMEL STUDIO in C.

    By the way, I have a question on how to turn off the jtag in xmega 128A1U because I have inactive pins PB4 to PB7. I read that it was done by fusebits, but I did not find anything specific. I program through PDI or sometimes through Flip, so JTag does not need me.

    I know it's best to write something myself to learn, but for now it's beyond me, and you can learn quite well by examples. And for the next steps of learning, the display that works properly will definitely be very useful.
  • ADVERTISEMENT
  • #2 15319188
    excray
    Level 41  
    On the website of the Helion publishing house, the tff (Tomasz Francuz) books are examples of downloadable codes.
  • #3 15319200
    kamil1555
    Level 11  
    I have both books on xmega and I use it. Very useful and it is the only such good and widely described material on the topic of xmega in our language, but unfortunately I did not find there the LCD support via TWI.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 15319275
    kamil1555
    Level 11  
    Thank you for the links, but I already know them and unfortunately I am not able to create my own library for LCD support via TWI, and there is no such example. Once, even Tomasz French himself wrote:
    tmf wrote:
    You can throw away the old library - in XMEGA, TWI / I2C support looks completely different, so you have to rewrite the basic communication functions or look for the ready-made network. There are Atmela examples but based on ASF, IMHO massacre.

    in this topic: https://www.elektroda.pl/rtvforum/topic3023978.html#14638033#postingbox
  • ADVERTISEMENT
  • Helpful post
    #6 15319401
    tmf
    VIP Meritorious for electroda.pl
    Unfortunately, TWI in the book about XMEGA did not fit. Personally, I strongly discourage the use of TWI / I2C - well-written handling of this interface, including any errors that may occur on it and deadlocks is not trivial. The net is full of examples, how to do this service anyhow, as a result, users later write that I2C hangs, etc. Probably soon I will put a DWI example on the blog of Dond on XMEGA, but it's a matter of a month. In the meantime, take a look at:
    http://www.fourwalledcubicle.com/files/LUFA/D...1/html/group___group___t_w_i___x_m_e_g_a.html

    Taking into account the author's person, I can safely recommend this code.
  • #7 15319536
    kamil1555
    Level 11  
    Thank you for your help in this topic and for explaining what and how. In that case, until the article appears, I will stay with the LCD without TWI. And as for the link, thank you very much, because I have several sensors with SDA and SCL outputs, so I will combine to read something from them.

    Now my second question is:
    How to disable the JTAG interface in xmega 128A1U, because I have inactive pins PB4 to PB7. I read that it was done by fusebits, but I did not find any "how to".
  • Helpful post
    #8 15320672
    tmf
    VIP Meritorious for electroda.pl
    Do you use Atmel Studio? If so, in the Device Programming window, you enter the Fuses tab and deselect JTAGEN and then click on the Program. You can also lock it programmatically, but you have to do it every time you start the program.
  • #9 15321165
    kamil1555
    Level 11  
    Cool. Thank you very much. Sometimes something is simple, but you can not see it at first glance. The ports are already working. In that case, I am waiting for example from TWI on XMEGA. Best regards and thank you colleagues for your interest in the topic.

Topic summary

The discussion revolves around the challenge of interfacing an HD44780 LCD display with an XMEGA 128A1U microcontroller using the TWI (I2C) protocol via a PCF8574T expander. The original poster seeks functional examples or libraries for this setup, expressing difficulty in finding specific resources. While some users provide links to general resources and caution against the complexities of TWI/I2C implementation, they also mention the lack of direct examples for LCD support. Additionally, the poster inquires about disabling the JTAG interface to activate unused pins, receiving guidance on using Atmel Studio to modify fuse settings.
Summary generated by the language model.
ADVERTISEMENT