Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
March 15, 2005, 11:23 am

Someone HELP!!!!
For the last month or so I have been trying to get a 18F452 PIC to
transmit several bytes of information every .5 of a second to a
16F877. The 18F452 is set up as a master and the 16F877 is setup as a
slave. I have used an osciliscope on the outputs of the 18F452 and I
am certain that I am getting the correct start bit and address
programmed into the 16F877. For some reason the 16f877 never seems to
want to recognise the start bits. I have gone through my programming
numerous times now and connot see the problem. All my interrupts are
set, I2C is configured correctly and my ports are configured. I have
no idea what the problem could be, I thought it might be the bus but I
am sure that is not the case. I do pull-up both SDA and SCK with +5v.
It is really starting to bug me, as i have never had so much trouble
with microcontrollers before that i haven''t been able to figure out.
If anyone out there can give me some pointers it would be of great
help. Even some sites that i haven't been able to find yet would be
nice to, or maybe even some code that works. Well hope someone has had
the same trouble as myself.
Robert

Re: I2C comms between an 18F452 and 16F877 using the MSSP in both chips
Hopkins
Well I have changed it all again. Haven''t testted what I am using,
but I decided to download the Microchip Application Maestro. It seems
to be build well enough, but as I said I haven''t tested it, but I
hope I will soon. Do you want to look at my 18F code instead???


Re: I2C comms between an 18F452 and 16F877 using the MSSP in both chips

If I remember correctly the pull up should be 10k when using 100kbps and 4k7
when using 400kbps.
When the speed is increased the pull up resistors should be smaller because
the faster the transmission line is the more current does it need to change
the voltage.
Cheers
Rune

Re: I2C comms between an 18F452 and 16F877 using the MSSP in both chips

I have had problems getting the bus to work and have gotten it to work
correctly just by changing the size of the pull-up resistors. If you look
at the spec for the pull-up resistors, it specifies a value based on total
on total system line capacitance. 4.7K for a 400K bus is a good
rule-of-thumb, though. You may have to vary the value a bit for better
(more reliable) performance.
One thing you might want to try is to set up an interrupt based on receive
data on the I2C interface. You could also try just looking at the input pin
and confirming what you see is what you think you should see.
Good luck.
Dave
Site Timeline
- » 200 C High Temp. design.
- — Next thread in » Microcontroller Discussions
-
- » microcontroller printer
- — Previous thread in » Microcontroller Discussions
-
- » New(ish) assembler for PIC16 microcontrollers (asm1825)
- — Newest thread in » Microcontroller Discussions
-
- » (PDF) Essentials of Anatomy & Physiology 2nd Ed by Kenneth Saladin
- — The site's Newest Thread. Posted in » Electronics (Polish)
-
- » Cortex-Mx MCUs with SWD access locked
- — The site's Last Updated Thread. Posted in » Embedded Programming
-