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.

Advantages of PIC18F4520 and TC74

Status
Not open for further replies.

InNeedOfHelp

Full Member level 3
Joined
Dec 5, 2012
Messages
169
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,205
Hi guys,

does anyone know what is the advantages for pic18f4520 and tc74?
I need it to do my school assignment..
 

Well, it's relative. What are you comparing this against that you're looking for advantages?

Some pros of using TC74:
  • Communicates via I2C. So, you can use multiple devices on the same bus.
  • Low power.
  • Small footprint.

Hope this helps.
Tahmid.
 
Im putting it to a powerpoint slides for my midterm presentation
 


:bigdogguru, what is the meaning of

Internal oscillator support-31 kHz to 8MHz with 4xPLL??

- - - Updated - - -

is
Code:
 #include <i2c.h>
or
Code:
#include "i2c.h"
 

what is the meaning of

Internal oscillator support-31 kHz to 8MHz with 4xPLL??

It means that you can configure the internal oscillator to use a "base clock" with frequency lying between 31kHz and 8MHz. You can also use PLL functionality on the internal oscillator to achieve higher clock frequency. Eg 32MHz from the internal oscillator configured as 8MHz.

Hope this helps.
Tahmid.
 

Thanks, regarding on I2C Protocol, how do i initialize it ? if i use different chips to build programs can i still use the same file repeatedly over and over again?
 

:Tahmid, PicDem Board 02-01630-1 Year 2002 and PicDem Board 02-01630-1 Year 2010.
Is there any difference between them ? Other LEDs Size and colour of the board?
the layout of the board and the connections are the same am i right ??
 

Thanks, regarding on I2C Protocol, how do i initialize it ? if i use different chips to build programs can i still use the same file repeatedly over and over again?

Due to the large number of chips availalbe, it would be difficult to make a generaralization. I don't think you can use the same code for each and every controller out there. You should go through the datasheets of the chips you are planning to use and compare the I2C modules of each. If you are, however, using a compiler library function, code portability will be better and atleast, the I2C functions can be (usually) reused.

:Tahmid, PicDem Board 02-01630-1 Year 2002 and PicDem Board 02-01630-1 Year 2010.
Is there any difference between them ? Other LEDs Size and colour of the board?
the layout of the board and the connections are the same am i right ??

Regarding PICDem, I'll have to take a look. If you have the relevant product datasheets or manuals, please link to them or upload them. If you don't, it's okay; I can find them through Google.

Hope this helps.
Tahmid.
 

Due to the large number of chips availalbe, it would be difficult to make a generaralization. I don't think you can use the same code for each and every controller out there. You should go through the datasheets of the chips you are planning to use and compare the I2C modules of each. If you are, however, using a compiler library function, code portability will be better and atleast, the I2C functions can be (usually) reused.
If my I2C is 24lc256 , is this codes correct?

Code:
void Call_Init_I2C (void)
{

	TRISCbits.TRISC3=1; //Set RC3 and RC4 as input
	TRISCbits.TRISC4=1;
	SSPCON1 = 0x28; // No collision/ No overflow/ SDA and SCL as serial port/ Clock stretch/ Enable I2C master mode
	SSPSTAT=0x80; // Disable slew rate control for Standard Speed mode.
	SSPADD = 119; // Set Baud rate as 100kHZ

}

void Start_I2C (void)
{
	SSPCON2bits.SEN = 1; // Enable start condition 
	while ( SSPCON2bits.SEN)Nop(); // Wait for SEN to go LOW.
}

void Send_To_Slave(unsigned char code)
{
	PIR1bits.SSPIF=0; // clear SSPIF flag
	SSPBUF = 0b10011010;   // Send TC74 ADDRESS; default is 1001101 + (0 write or 1 read)
}

void Wait_For_ACK (void)
{
	while (SSPCON2bits.ACKSTAT); // Wait for ACKSTAT to go LOW. 
	while(!PIR1bits.SSPIF)Nop(); // Wait for SSPIF flag to go HIGH.
}

void Restart_I2C(void)
{
	SSPCON2bits.RSEN = 1;  // Repeated Start Condition Enable bit
	while (SSPCON2bits.RSEN)Nop();  //Wait for RSEN to go LOW. 
}

void Switch_To_Read_Mode (void)
{
	SSPCON2bits.RCEN = 1;  // Enable Receive mode
	while ( SSPCON2bits.RCEN)Nop();  // Wait for RSEN to go LOW. 
}

unsigned char Load_From_Slave(void)
{
	unsigned char temp;
	temp = SSPBUF; // Load to "temp" variable  
	return temp;
}

void Send_NACK(void)
{
	SSPCON2bits.ACKDT = 1;// Send NOT-ACK. 
	SSPCON2bits.ACKEN = 1;
	while ( SSPCON2bits.ACKEN) Nop(); // Wait for ACKEN to go LOW. 
}

void Stop_I2C(void)
{
	SSPCON2bits.PEN = 1; // Initiate STOP condition 
	while( SSPCON2bits.PEN) Nop(); //  Wait for PEN to go LOW. 
}

unsigned char  Get_Temp_Result (void)
{
	unsigned char temp;
	//Write According to Receive Byte Format
	Start_I2C ();  //Start Condition
	Send_To_Slave(0X9A)  ;  //Send to slave 7bit Address (1001 101) + RD (1)
	Wait_For_ACK(); //Wait for ACK from slave
	Switch_To_Read_Mode(); //Switch to Read mode in order to receive from Slave
	temp = Load_From_Slave(); //Get data from Slave
	Send_NACK(); //Send NACK 
	Stop_I2C(); //Stop Condition 
	return temp;
}


void Display_In_BCD (unsigned char this_number)
{
	unsigned char First_Deci; //First Decimal //Local variables
	unsigned char Second_Deci; //Second Decimal
	unsigned char Third_Deci; //Third Decimal

	//the limit of TC74 sensor: +127 to -65 degree

	if (this_number > 127 ) //if more than 127 then go to minus range
		
	{
		this_number = 256- this_number;
		putrsLCD(45); //put minus sign
	}
		

	First_Deci = this_number/100;
	Second_Deci = (this_number /10)%10;
	Third_Deci = (this_number/1)%10	;
			
	if (First_Deci != 0){putrsLCD(First_Deci);}  //Show first digit
		
		Delay10KTCYx(10); 
		if (Second_Deci != 0 || First_Deci != 0){putrsLCD(Second_Deci);} //Show second digit
		Delay10KTCYx(10); 
		putrsLCD(Third_Deci); //Show third digit
		Delay10KTCYx(10); 
		
	
}
void Call_Init_USART()
{
		OpenUSART( USART_TX_INT_OFF & 
		USART_RX_INT_OFF &
		USART_ASYNCH_MODE &
		USART_EIGHT_BIT &
		USART_CONT_RX &
		USART_BRGH_HIGH,	
		25); //Bit per second:9600 / Data bit: 8 / Partiy bit : None / Stop bit : 1 / Flow control : None
}


void initLCD(void)
{
	TRISD = 0x00;
	PORTDbits.RD7 = 1;  //Power On LCD
	OpenXLCD(FOUR_BIT & LINES_5X7);
	putrsLCD((const far rom char*)"Initializing LCD...");
	
	while (1)			// run forever; infinite loop
	{  
               
		data= Get_Temp_Result (); //Get Result from TC74
		Display_In_BCD (data); //Display Temperature result in BCD (then convert to ASCII code)
		putrsLCD(32); //space 
		putrsLCD(32); //space
		Delay10KTCYx(100); // one second delay
	}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top