Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - PCF8574 I2C LCD & DS3231 Real-Time Clock

(you are viewing a thread; or go back to list of threads)

PCF8574 I2C LCD & DS3231 Real-Time Clock (by OnosTech)
Hi everyone,

I finally made and uploaded a YouTube tutorial video that should answer a lot of questions on I2C LCD.

Many thanks to José for developing the I2C function and for providing guidance to everyone in this forum.

https://youtu.be/Mj5K6ZTT21Q

Best Regards
OnosTech
Sat Mar 27 2021, 09:44:00
(no subject) (by José)
Nice tuto that will greatly help users of I2C bus !
Sat Mar 27 2021, 16:43:56
(no subject) (by OnosTech)
Thanks again. I hope we can have full support for Modbus soon
Sun Mar 28 2021, 08:47:12
CONTADOR ORAS YMINUTOS (by Manuel)
Hola Onos

alfin e cosigido foncionar el reloj de siete sementos
pero en los segundos me varia mucho yo preguntaba se pudia hacer con un ds1307 o otrosisteme de precision que los segundos sen exatos nose si algin del foro lo a echo alguna vez los
segundos de todos los plcs no son exatos
E STADO VIENDO TU TITURIAL DE LA PNTALLA DE LCD Y ES MUY BUENO
LO PODRIAS PUBLICAR EN ESPAÑOL EL VIDO
GRACIAS POR TI COLABORACIN
UN SALUDO MANUEL
Mon Mar 29 2021, 06:17:18
(no subject) (by OnosTech)
The seven-segment clock can be done with the DS1307 or the DS3231 which is more accurate.

I am sure we can continue collaborating. You can reach me at [email protected]
Tue Mar 30 2021, 04:02:58
(no subject) (by José)

Yes ; I personaly use a DS1307 for testing purpose and it works fine with I2C.
Tue Mar 30 2021, 10:14:40
Thanks (by Rajeev Rawal)
Dear Sir,

very good, hope The seven-segment clock would be very interesting.
Tue Mar 30 2021, 14:01:13
DS 1307 (by Manuel)
Hola Jose yo se que tu en ldmicro eres una maquina

yo comento el modulo ds1307 o el modulo 3231

necesitaría un programa como conectarlo al un pic 16f628 o 16f876 yo trabajar en 12c no estoy acostumbrado de momento

Un saludo Manuel
TE ENVIO MI PROGRAMA DE LD MICRO PARA QUVEAS COMO ESTA ECHO
AN
VER SI U TIENES OTRA MEJORA
Tue Mar 30 2021, 14:58:32, download attachment SIETE SEGMENTOS 16F628.hex
(no subject) (by OnosTech)
Hi Manuel,

The DS3231 and DS1307 work the same way. The same program will work for both. Whichever you use is okay. However, you will need to attach the ladder file instead of the hex file.

Best Regards
Onos
Tue Mar 30 2021, 15:43:03
5 digit up counter with preset using 16f628 (by Shreyash Sakhare)
Hello onos
I am trying to build a 5 digit counter program and i have successfully simulated the program. But when i upload the program into the pic 16f628 microcontroller. The program does not run on the circuit. Does we have to define something on ldmicro for internal oscillator? Plese help
Tue Mar 30 2021, 23:58:33, download attachment Counter Schematic updated.pdf
5 digit up counter with preset using 16f628 (by Shreyash Sakhare)
The ld micro file is attached
Tue Mar 30 2021, 23:59:36, download attachment up down counter.ld
(no subject) (by OnosTech)
Hi Shreyash,

Since you are not using an external oscillator, set your MCU crystal frequency to 4 MHz and the PIC Configuration Bits to 0x3F62 and try again.

Best Regards
Onos
Wed Mar 31 2021, 06:38:27
5 digit up counter with preset using 16f628 (by Shreyash Sakhare)
Thanks for reply sir, i tried what you suggested but still it is not working
Fri Apr 2 2021, 08:19:45
(no subject) (by OnoTech)
I will find time to look at it thoroughly and revert
Fri Apr 2 2021, 16:44:27
(no subject) (by Shreyash Sakhare)
I really appreciate that thanks
Sat Apr 3 2021, 02:34:19
(no subject) (by MGP)
Your calculations are incorrect, I have not looked at the rest.

Example: 823 mod 100 = 23 which is more than 1 digit

Also note that Ldmicro can only make 16-bit calculations, 99999 is too big.
Sat Apr 3 2021, 03:14:46
(no subject) (by OnoTech)
This PIC configuration bits 0x3F58 should work. I think for the best result you should use a PIC with more pins so that you can use a crystal oscillator of 20Mhz. PIC16F876 should be fine.

@MGP, You are correct about the 16-bit calculation. But this was updated in release 4.3.0. Below is from the user manual:

UPDATED: Release 4.3.0
Variables can allocate 1,2,3 or 4 bytes. You can change size of variable by
double-clicking the variable name in the list at the bottom of the screen.
Variables are stored and processed in the two's complement form.
See https://en.wikipedia.org/wiki/Two%27s_complement

Bytes Types Range from to
1 signed int8 -2^7 = -128=0x80 2^7 -1= 127=0x7f
2 signed int16 -2^15= -32768=0x8000 2^15-1= 32767=0x7fff
3 signed int24 -2^23= -8388608=0x800000 2^23-1= 8388607=0x7fFFFF
4 signed int32 -2^31=-2147483648=0x80000000 2^31-1=2147483647=0x7fffFFFF

The decimal zero value (0) is represented as all zeros bits 00...000
The decimal value (-1) represented as all 11...111

Signed int8 variables are used for make the hex file smaller and faster.
Signed int24 and int32 types are used to upsize range of variables.
Sign extension for variables of different sizes are provided automatically.
Note: MUL, DIV, MOD instructions can't processed int32 variables.

The 99999 should be in the range of int24. I also did a simulation on LDmicro to verify

@Shreyash Sakhare confirm if it works as expected by you
Tue Apr 6 2021, 06:27:40
(no subject) (by MGP)
@Onotech, I didn't know you could make calculations with 24bit numbers, thx.
Tue Apr 6 2021, 07:14:09
(no subject) (by OnoTech)
I didn't know either. I just found it too
Wed Apr 7 2021, 07:55:11
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):