I2C and RTC DS1307 🔴 PIC Microcontroller Programming Tutorial #11 MPLAB in C

preview_player
Показать описание
In this PIC programming tutorial I will demonstrates how to setup the I2C in master mode and using a DS1307 real time clock. Using the XC8 compiler with MPLAB X and a PIC18F4520 PIC microcontroller.

Git Repository

➥➥➥ SUBSCRIBE FOR MORE VIDEOS ➥➥➥

☕Coffee Funds☕
Shekels
Patreon
Bitcoin
19nohZzWXxVuZ9tZvw8Pvhajt5khG5mspW
Ethereum
0x5fe29789CDaE8c73C9791bEe36c7ad5db8511D39

00:00 Intro
00:06 PIC Microcontroller Schematic
00:35 PIC Microcontroller Datasheet I2C
05:23 DS1307 Datasheet
07:00 Code Overview
07:50 I2C Code
14:07 DS1307 Code
19:24 I2C/DS1307 Demo
19:41 Outro

#picprogramming #picmicrocontroller #MPLAB
Рекомендации по теме
Комментарии
Автор

If there is anything you would like to see let me know.

BinderTronics
Автор

Really very good Video, actually every video is great. Please keep it up make more videos. Thank you

parthbaraiya
Автор

you are good man thak you for tutorial

leventdemirci
Автор

I really appreciate you! can you make 1 video about i2c communication between 2 pic 18f4520. that will help me a lot <3

ユンユン-by
Автор

Very good .... the best I2C tutorial I've seen.
I have a 16f15376 pic and the datasheet is very similar to the one it presented.
I followed it step by step, but couldn't make the SDA and SCL outputs generate the square waves they were supposed to.
Could you take a look at my code?
thanks

robinight
Автор

i worked on I2C and i used RFID device PN532 of adafruit so do you think it is compatible with the PIC microcontroller?
2) do you think every component is compatible with every Microcontroller?

parthbaraiya
Автор

Don't understand the meaning of
uint8_t YearL:4;
uint8_t YearH:4;

.
.
.
etc.
Could u explain? thz u

naylinaungaung
Автор

when i recv from slave i always get 0xFF
what is the problem??
unsigned char i2c_read(unsigned char ack)
{
unsigned char res;

i2c_wait_if_busy();
SSPCON2bits.RCEN = 1;
while (!SSPSTATbits.BF);
w8();
res = SSPBUF;
SSPCON2bits.ACKDT = ack;
SSPCON2bits.ACKEN = 1;

return res;
}
w8 function waits for SSPIF and clear it again
and wait if busy just waits if bus is busy

alikhorami
welcome to shbcf.ru