Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I²C and RS232 on the same PIC

Status
Not open for further replies.

l30

New Member
Ok friends, first of all, sorry for my bad english, it's not my primary language.

I have an average knowledge of analogic eletronic, but just a little of digital, and need some help on a project. I have to READ and WRITE data from a Real Time Clock (in case, a DS1307) using a PC. I've tryed to do it without a uC, but can't make it work so I decided to use one.

I want run an application (that part - send and receive data from the RS232 on the PC side isn't a problem) on my PC that will send via RS232 a command to the PIC saying:"Write the date/Time XXXXXXXX on the RTC", and the PIC will WRITE it via I²C to the RTC.
Or I will say "Read the Date/Time of the RTC" and the PIC will read it and send it to my application via RS232.
From my researches i found out that a PIC16F628 would be the right choice. Am I right?


It is possible to do that? HOW?
If someone can help me with the code and connections, send me some links, tips, anything would help.
I have seen som examples on how to read/write on I²C EPROMS, and was thiking if I can use a similar schematic, but the main problem than it's the uC code.... please, if some of you have the time to help, i'll apreciate a lot.

i have just found this link:
CODE:
**broken link removed**
SCHEMATICS:
**broken link removed**

looks like what i need, but not sure about the RS232 part... looks like it is not implemented on the CODE...any idea?

thanks
 
This might be what you are looking for??

App Note 206: Using a PC's RS-232 Serial Port To Communicate with 2-Wire Devices
**broken link removed**

the document is a "how-to" for using a cheap PIC to be a translator between PC and SMBus / I2C ... they even include a windows interface program (with code) and a pre-compiled HEX (with source) for a PIC16FL628

-----
just fyi here is a run down of my serial interface project on a PIC18F series!

pic 18F452 that is currently utilizing 4 serial buses:

Serial output to a serial LCD using a general purpose pin
Dallas 1-Wire I/O using a single general purpose pin
I2C Master Mode I/O using the pic's hardware MSSP ports (2 pins)
RS232 via a max232n using the pic's hardware USART ports (2 pins)

there is an occasional glitch with the rs232 when I try to write to the LCD and the RS232 at the same time, haven't quite figured that out

I'm using Proton PicBasic Plus ... there is a free version on their website that might fit your needs.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top