Hello, I have problem with .C programming! (Working with Code Vision for AVR). I have set up one PCF8591 on I2C BUS.
Can You help me with code, where I m doing wrong?
Chip type : ATmega8515 Program type : Application Clock frequency : 4,000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128
Communication parameters: 9600 8N1
[RS232 SPARE header] [PORTD header] RXD - 1 PD0 TXD - 2 PD1I2C bus port bits allocations for PORTA NOTE: 3.3k..4.7k PULL-UP RESITORS TO +5V MUST BE USED FOR THE SDA & SCL I2C BUS SIGNALS
*****************************************************/ /*#include// printf #include
#include
// I2C Bus functions #asm .equ __i2c_port=0x1B ;PORTA .equ __sda_bit=0 .equ __scl_bit=1 #endasm #include
// Alphanumeric LCD Module functions #asm .equ __lcd_port=0x15 ;PORTC #endasm #include
// Declare your global variables here //char lcd_buffer[33]; int ch; int vlt; int volts2; // int j;
void main(void) { // Declare your local variables here
// enable the transmitter UCSRB=8; // Baud=9600 @ 4.000 MHz UBRRL=25;
// I2C Bus initialization i2c_init();
// Initialize the LCD for // 2 lines & 16 columns lcd_init(16);
// go on the second LCD line lcd_gotoxy(1,2);
// temperature transmission loop
while (1) { //for(j=0;j