CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

18F2550 master and atmega328p slave i2c
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eng.mohamedtoumi



Joined: 13 Jan 2018
Posts: 23
Location: Tun

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 18, 2018 4:21 am     Reply with quote

temtronic wrote:
I'd like to see a picture of the hardware, though since the numbers are reported on a 'schematic LCD' NOT a PC, I think it's all a simulation.

yes it is a simulation on isis proteus 8.6 sp2 ...
Ttelmah



Joined: 11 Mar 2010
Posts: 13654

View user's profile Send private message

PostPosted: Thu Jan 18, 2018 5:45 am     Reply with quote

Read the sticky at the top of the forum.

You are wasting both our time and yours. Proteus (Isis) has fundamentally flawed models for a huge percentage of PIC peripherals. You can spend an age chasing problems, and then when you have it working, have to do the same again when you go to the real chip....
temtronic



Joined: 01 Jul 2010
Posts: 6286
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jan 18, 2018 6:02 am     Reply with quote

Well it wasn't a total waste of time.
first, he's confirmed that Proteus is 'busted ' for simulating Atmega micros as well as PICs. Guess we have to ask everytime if it's real or fake project, sigh.
I finally clued in with the numbers being on the paper LCD.

2nd, I found my Atmega box of goodies while replacing the furnace fan motor. As heat was being restored in the house (5*C brr), I cobbled PIC and Atmega for a test. In less than 2 hours I had the PIC master controlling the Atmega slave via I2C, so I KNOW it can be done....fairly easily too.

Jay
eng.mohamedtoumi



Joined: 13 Jan 2018
Posts: 23
Location: Tun

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 18, 2018 1:36 pm     Reply with quote

[problem solved] Hello thank you all for your replies ...
i made these changes for the pic code and it works correctly
Code:
 
    i2c_start();                               
      i2c_write(0x10);
      delay_ms(10) ;                   
      i2c_write(mode);
      delay_ms(10) ;
      delay_ms(10) ;
      i2c_stop();


The atmega code stays the same one like the previous.
As an advice just run the pic i2c slave scanner because the atmega uses a 7 bits address while the 18F uses 8 bit address this might be confusing ...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group