Part Number: ADS1230
Hello everybody, i do it for read adc.
#define SCLK1 PORTB|=(1<<PORTB2)
#define SCLK0 PORTB&=~(1<<PORTB2)
#define PDWN1 PORTB|= (1<<PORTB3)
#define PDWN0 PORTB&=~(1<<PORTB3)
#define DOUT (PINB&(1<<PINB1))
// DOUT B1 SCLK B2 PDWN B3
#include <avr/io.h>
#include <util/delay.h>
#include <stdio.h>
#include "rs232.h"
uint32_t veri=0;
uint32_t adcoku(void)
{
uint32_t bilgi=0;
while(DOUT);
for(int i=0; i<20; i++)
{
SCLK1;
if(DOUT)
{
bilgi|=0x00001;
SCLK0;
bilgi<<=1;
}
else
SCLK0;
bilgi<<=1;
}
return bilgi;
}
Where is the error ?
