News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

I2C, PCF8574

Started by FATİH YILMAZ, Sep 15, 2023, 10:04 AM

Previous topic - Next topic

FATİH YILMAZ

Arkadaşlar. Türkiye'den herkese selamlar.
Ben de zaman zaman mikrodenetleyicilerle bazı denemeler yapıyorum. Ancak daha önce internette paylaşılmamış veya çok az bilgi olan konulara uzun sürelerle takılıp kalıyorum. Ben özellikle I2C ile birden fazla belki de 8 adet karakter LCD yi PCF8574 kullanarak çalıştırmak istiyorum. Her bir LCD de farklı bilgiler görmek istiyorum. Tek LCD kullanarak I2C protokolü ile "Heloo World" yazıyorum ancak bir baska LCD ekranda da aynı zamanda "Hello Mars", "Hello Moon" yazmak istiyorum. Bu konuda C dili ile programlama yapılmış veya Arduino ile yapılmış örnekler var ama ben protonu kendime daha yakın bulduğum için Proton Compiler ile çalışmak istiyorum.
Ekte yer alan resimdeki gibi bir devre ile iki adet veya daha fazla LCD ekranı aynı I2C hattı üzerinden kontrol etmek, aynı I2C hattı üzerinden başka sensörlerden de bilgi alarak LCD ekranlarda görmek istiyorum. Aynı zamanda LCD ekranların aydınlatma LED lerini ayrı ayrı kontrol etmek istiyorum. Bu konuda bana yardımcı olabilecek herkese şimdiden teşekkür ediyorum. İyi İngilizce konuşamadığım için herkesten özür diliyorum. Bu nedenle Türkçe yazmak zorunda kaldım.



top204

Ask questions in the English language please.


RGV250

Translated by Google

Friends. Greetings to everyone from Turkey.
I also do some experiments with microcontrollers from time to time. However, I get stuck for long periods of time on topics that have not been shared on the internet before or about which there is very little information. I especially want to operate more than one, maybe 8 character LCDs using PCF8574 via I2C. I want to see different information on each LCD. I write "Heloo World" with I2C protocol using a single LCD, but I also want to write "Hello Mars", "Hello Moon" on another LCD screen. There are examples of programming in C language or Arduino, but I want to work with Proton Compiler because I find proton closer to me.
With a circuit like the attached picture, I want to control two or more LCD screens over the same I2C line, and receive information from other sensors over the same I2C line and see it on the LCD screens. At the same time, I want to control the illumination LEDs of the LCD screens separately. I would like to thank in advance anyone who can help me with this. I apologize to everyone for not speaking English well. That's why I had to write in Turkish.

Pepe

demo lcd proteus with library for i2c

Yves

Hi Pepe,

Is it possible for you to convert  the Proteus simulation for the version 8.13. I have not upgraded to the 8.15 yet. Many thanks.

Regards,

Yves
Yves

Pepe

This are the conections

eozkantar

asm
üstteki resimdeki gibi 8 adete kadar lcd bağlayıp adres bağlantılarını farklı bağlayıp,  her i2C nin kütüphanesin deki LCDadreslerini düzenlemen gerek.

GDeSantis

You need to connect up to 8 LCDs as shown in the picture above, connect the address connections differently and edit the LCD addresses in the library of each i2C.

FATİH YILMAZ

Pepe, hello. Thank you very much for your interest. I am 58 years old and I have been dealing with electronics as a hobby for many years (I think 45 years). I started to deal with microcontrollers in the last decade, but I am not a professional in this field. From time to time I get away and start dealing with it again. I am an amateur radio operator, so I have to work in all areas of electronics from time to time. Sometimes I started to need to operate more than one LCD screen with the same microcontroller, and sometimes the same LCD screen with more than one microcontroller. The I2C protocol attracts my attention because the number of Pins used is low and it allows multiple modules to be operated simultaneously on the same line. That's why I thought of getting support from the form.
I went through the case study and simulated the circuit with proteus. The simulation works with the Hex file in the additional Zip file. I saw that more than one I2C LCD can be operated with Proton IDE. This made me very excited. I was starting to think this wasn't possible because I couldn't see enough examples before. But when I tried to recompile the .BAS file, I encountered an error. I think that a .BAS file and Include file that you had previously worked on, but had not been finalized, might have been put into the form by mistake. Is it possible to upload the working .BAS and Include file to the form? Thank you.

FATİH YILMAZ

The version I use is IDE 2.0.1.0

FATİH YILMAZ

During compilation, I encountered problems in the pictures in numerical order. I know. I'm very novice. Maybe it's a very easy problem, but I couldn't overcome these mistakes.

Pepe

#11
Program with library included

FATİH YILMAZ

Pepe. I realized that I have a lot to learn about ProtonCompiler from this site and you. Thank you very much for your interest and answers. Goodbye.

FATİH YILMAZ

Pepe Hello again. I simulated the files you sent. It works very well. I would like to ask you again regarding this issue. Is it possible to use more than one I2C LCD (PCF8574) with microcontrollers that are lower than PIC18F46K20 and do not have hardware I2C, such as 16F628A? Sometimes microcontrollers such as PIC18F46K20 can cause more capacity to be used. Is it possible to see simple but multiple information with several I2C LCDs with 16F628A? Thank you.

Yves

Quote from: Pepe on Sep 18, 2023, 12:13 PMProgram with library included
Hi Pepe,
do you have the previous version of Proteus (8.13)? Thank you.

cheers

Yves
Yves

FATİH YILMAZ

Yes. I have Proteus 7.7 version

Pepe

Modified for para 16f628a

Pepe

proteus 8.13 version

top204

Excellent code examples Pepe.

Remember Pepe, the compiler now uses "__Print_" as its subroutine call name for the Print command, and the original subroutine name will cause an assember error to be generated. If in doubt, use both of them together in the BASIC code's listing. But, as you know, the original "print" subrotuine name will need to be wrapped in assember directives, and the "__Print_" name can be created as a BASIC listing subroutine name. i.e. __Print_:


FATİH YILMAZ

Pepe. I simulated the circuit. It worked very well. I recompiled it with a small change. The result is excellent. Thank you very much for your reply and sharing the sample program. You are a great programmer.