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 with PIC46k80 mikroc pro large frame

Status
Not open for further replies.

desgin

Full Member level 1
Joined
Apr 7, 2017
Messages
96
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
813
Hello All,

I am working with mikroc Pro licence version.
I am using pic46k80 mikroc Controller.
I received 1 frame that is 8 bytes frame from CAN, Received at my controller side.
I want to send that 1 frame to another Controller through I2C.
How to do ? Please help me. In library they given like;

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void main(){
  ANSEL  = 0;                // Configure AN pins as digital I/O
  ANSELH = 0;
  PORTB = 0;
  TRISB = 0;                 // Configure PORTB as output
 
  I2C1_Init(100000);         // initialize I2C communication
  I2C1_Start();              // issue I2C start signal
  I2C1_Wr(0xA2);             // send byte via I2C  (device address + W)
  I2C1_Wr(2);                // send byte (address of EEPROM location)
  I2C1_Wr(0xAA);             // send data (data to be written)
  I2C1_Stop();               // issue I2C stop signal
 
  Delay_100ms();
 
  I2C1_Start();              // issue I2C start signal
  I2C1_Wr(0xA2);             // send byte via I2C  (device address + W)
  I2C1_Wr(2);                // send byte (data address)
  I2C1_Repeated_Start();     // issue I2C signal repeated start
  I2C1_Wr(0xA3);             // send byte (device address + R)
  PORTB = I2C1_Rd(0u);       // Read the data (NO acknowledge)
  I2C1_Stop();               // issue I2C stop signal
}



but i want to send full frame, how to send ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top