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.

[SOLVED] I2C Communication to read temperature

Status
Not open for further replies.
I

imroun1992

Guest
Newbie level 1
Hello,

I am using Keil µVision 4 to program MCB 4357 Development Board. I want to read out the temperature of LM75 thermometer with I2C protocol.
But I don't know how can I establish I2C communication with LM75. I have header files to write c code but i don't know how it programming.

THE LM75 ADRESS IS 0x48. Anyone to help me to write c code to read out temperature, this is first time that i program a microcontroller. It will be useful for me that anyone show me how write a program to intialize I2C and read out temperature

Kind regards
 

Attachments

  • source files.zip
    5 KB · Views: 107
  • mcb4300v1-3-schematics.pdf
    599.1 KB · Views: 91

Hello,

I don't understand C sorry,
But first you must send the address:10010001 (View Data Sheet Table.1).
and then the read command "0x00" Read only (View Data Sheet Table.2)
My Code Work ..

-----------------------------------------------------
Dim Temp as Word
I2CREAD PORTB.1, PORTB.3,%10010001 ,0x00, [Temp]
Print $fe,1,DEC5, Temp 'Out Display
 

Hello,

Thanks You but i'm a novice in programming can you write for me a program in c language a program which read temperature and display ... This is first time i use MCB4357 DEV BOARD I don't know how to use it ..

I wrote program but this don't work :

Code:
#include <LPC43xx.h>                    
#include "GLCD.h"
#include "I2C.h"
#include "TH_LM75.h"
#include <stdio.h>


int main (void) {

  
	GLCD_Init(); 	          							
	I2C_Init();														
	TH_Init();	

TH_DATA Temp;														
	
 while (1) {

I2C_Start();
TH_GetTemp(&Temp);
 }
}
Anyone here to write program in c language to establish I2C Communication with LM75 ??

please help me


Kind regards
 
Last edited:

I'm Sorry did not know anything about C.

I hope this helps you:
**broken link removed**
 
Last edited:

Hello,

"Mondalot" it's ok but I am adressing to all people in this forum i heard that edaboard helps every problem in programming..
 

Look especially in the subroutine: int lm75_GetTemperature(void)
 

Hello,

this is useful but this is not the same programming for my MCB4357 DEV BOARD. look at the two files that i included in the first post. can you write a program in c or if you dont know can you ask to other forum people
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top