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 - could someone make an example using SFR for i2c?

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

could someone make an example using SFR for i2c? (by Alex)
Hello in this thread:

http://cq.cx/ladder-forum.pl?action=viewthread&parent=3895

Dzairo said:

"Hi.

In this days I work in new function .

Read from SFR
Write to SFR
Set Bit in SFR
Clear Bit in SFR
Test if Bit is set in SFR
Test if Bit is clear in SFR

Why this function...

This function enable to experts complete control MCU.
For example:
read port in one instruction, write to port .. enable I2C (external LCD,ADC,DAC,Memory,RTC etc...) enable SPI, all timer/counter etc..
This special functioin enable control ram memory.. you can read write to internal ram.. "

Ihor made changes about SFR:

https://github.com/LDmicro/LDmicro/wiki/Replase-the-obsolete-elements

I am not an expert about I2C, i am learning and trying to understand it in my arduino UNO from scratch, i know there are libraries for a DS3231 or I2C LCD, but i really want to do it by myself, it is a little difficult for me, but as i really like LDmicro and i found that thread i would like to ask for an example using SFR for I2C ds3231, thanks in advance.
Sun Sep 23 2018, 18:01:23
(no subject) (by Alex)
i have tried to enable 1hz square wave function of the DS3231 with my arduino UNO, it worked using Ihorīs SFR and i made a counter with 1hz SQW to visualize it via serial communication with my arduino uno:


https://www.youtube.com/watch?v=Ms0eWEugwMo&feature=youtu.be


i donīt know if iīm doing it well but it worked, could you please check ladder if it is okay.

would be great to have this for PICīs .
Mon Sep 24 2018, 14:39:49, download attachment ds3231_ldmicro.ld
(no subject) (by Alex)
no, bad ,made a mistake it worked any way i don use sda scl
Mon Sep 24 2018, 14:45:59
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):