Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C and SPI help in PIC16F877A using hitech C

Status
Not open for further replies.

CyrusHong

Newbie level 2
Newbie level 2
Joined
Aug 11, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Penang, Malaysia, Malaysia
Activity points
16
Hi! I'm new to microcontroller and Hitech C, could anyone give me a guide in how to set up the register or setting (such as PIR2, SSPSTAT.... ) needed to use the I2C or SPI serial interfacing? A sample would be preferably, thank you!
 

Re: I2C and SPI help needed in PIC16F877A using hitech C

Hello there,

try these and update me
 

Attachments

  • PIC16F1784_To_I2C_EEPROM.zip
    6.4 MB · Views: 131
  • PIC16F1784_To_SPI_EEPROM.zip
    151.6 KB · Views: 152
Re: I2C and SPI help needed in PIC16F877A using hitech C

Thank you, Jinzpaul4u,;-) your code indeed help me have a better understanding about SPI and I2C. However if i wished to use SPI or I2C to link the communication between two microcontroller (pic16f877a), for example when the switch in the master pic is pressed, the green led in slave pic will lights up and when the switch in slave pic is pressed the red led in master pic will light up. Could you teach me how to perform it? By the way, is all the setting in pic16f1784 same with pic16f877a?
 

Just study the data sheet and configure it by yourself...

configure one controller as master and another as slave...

Rx the command frm master and turn on the LED if the corresponding command received...

As a newbie, the frst thing you need to understand is the function of each bit in every register...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top