pic16f84 with 24c256 on i2c - simulation ok, real not working. oshonsoft pic ide

Status
Not open for further replies.
are you refering to pin4 of the pic? No i don;t it is connected directly to +ve via a jumber wire. I am using a 7805 and it has a 100n across pin 4(mclr) and 5(neg) then a wire jumer goes to +ve pin.
the eeprom is connected via 5cm piece of 4core wire - positive connected to the track close to ppin 15(+) , SDA (pin 5 on eep.) connected to pin 10 of pic (rb4) , SCL connected to rb5, Gnd to Gnd.

I have tried a new eeprom and i took a pic from another project that was working.
what value should the resistor be?

maybe give me your version of the circuit? then atleast we are both trying exactly the same thing?

Thanks again for all the input.
 
Last edited:
hi hitch,
A quick sketch of what I have, it shows 24C1024, but it also works with a 24C256.

EDIT:
Added the 25C256 for clarity.
 

Attachments

  • AAesp03.gif
    5.8 KB · Views: 233
  • AAesp04.gif
    7 KB · Views: 234
Last edited:
thanks for the schematic, but other than the resonator and the 10k pullup on mclr - our circuits look identical!
I will make the changes and try again.
I was thinking maybe it is a compiler error? would it be possible to send me your hex file. - of the .bas i sent with rb4 = sda?
maybe it isn't hardware?

thanks.
 

hi,
Look at this zip, its got the compiler produced files that OS creates.

I guess next time I fly to PE I will go via Cape Town rather than Jo'burg..
I hope we can crack this problem.
Did you do a separate test program for the serial output, just sending a fixed string.?
 

Attachments

  • hitch1.zip
    12.1 KB · Views: 156
hi eric

i was thinking the same thing that when u next visit PE i will meet you there, lol. As my favorite saying goes "Great minds think alike .. but fools seldom differ" the last part keeps the size of my head in check, heheh.

I have purchaced two new eeproms, 24lc256 and am about to redo it all step by step, including the few changes you suggested.

I hope we crack this one aswell, I hate it when the machines win. even if it might be human error.

yes i made a prog that just send a few lines of text to porta.3 and it works perfectly.

thanks eric
 
Last edited:
SuCCESS!!!!!!

12:27am GMT +2

IT IS WORKING. The new circuit has a 10k pullup on pin 4 and i am using a 3pin resonator (4mhz) instead of the crystal and caps.
The eeprom which i had built on a piece of vero is still configured as is with the 2k2 pullups on sda and scl.

here is the thing, as i am writing this everything is working - 01234567 with ABCDEFGH and it is looping and beeping. When i tried it 5min after finishing the new board it did NOT work. then i daizy chained the comms from board 2 back to board 1. removed chip 2 and placed it in 1. ran the code and it was giving me the blank lines again. then i again powered down placed chip back into brd2 and then it just "sprang into life". I am afraid to disconnect board 1, hahahah. and i did not put in the 0.1uf decoupling caps yet.
Do you think the resonator vs crystal made all the diff?. i am glad it is working, now it is time to play!
A big thank you to you for all the info and patience and guidance.

p.s. i compared your .asm file with mine and your have :
list p=16f84a
#include <p16f84a.inc>
radix dec
i will recompile on my side and see if the prog still works. i will write to a diff pic coz i have to show my wife it is finally working!.
 
Last edited:
just another update.
on the working board, when i run the prgm without the eeprom inserted, i get the cursor actually moving the 8spaces then the crlf then the 8spaces then the crlf - just as in the code. In comparison to the 1st board which only gave the CRLF's !?! I am really stumpfed at the fact that all we changed was a 10k pull-up and swap the crystal for the resonator.
I have compiled the earlier versions of the software and all is well.

thank you again, I have posted a new question though regarding receiving data into the pic. your timing is really fast but when i do a receive and move each byte into the on-board pic eeprom i loose almost all of the bytes except the 1st. but i have opened a new post for that one.

thank you again.
 

hi,
My best 'guess' would be that with the EEP out of circuit, the PIC is reading a 'FF' which your PC is seeing as a 'non printable' character, so you get spaces.
When the EEP is in situ and not being read correctly it, the PIC is reading '00', which is a 'null' [control character] ,so not printed.???

Its important the PIC supply is decoupled as close as possible to its power pins, with say a 100nF.
 
hi eric

i understand that with the eep out the add was diff, but the point i was making was that on the reworked circuit i WAS getting it and in the 1st board i was not.

but i am happily writing to the eep now, thanks again. just have to sort out my receive function and i will be set.

i have the 7805 on the same board as my pic which have a 10uf on the input and 100n on the output. so is that enough? in any case it is working now as is.
 

hi,
Try that UART test basic on your other thread, it working fine.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…