Thread: Load Cell Scale
View Single Post
  #17   Report Post  
Posted to rec.crafts.metalworking
[email protected] david@thewoo.co.uk is offline
external usenet poster
 
Posts: 2
Default Load Cell Scale

Anything you have might be useful. I'm at the point of considering another chip. Interface wise, I'm doing communication with the uC over a serial connection and fully automating it, so the LCD, buttons etc might be superfluous.

A few specific problems I seem to have come across are below. Just wondering if they might be the same things that you had to overcome.

1) POL pin set low, SPI_MODE0 does not work. Only POL pin high and SPI_MODE3.

2) To get consistent reads of a register I have to introduce delays that, from my reading of the datasheet timing table, should not be needed. I also need to toggle the CS pin in between a read command and actually reading from the register, which doesn't seem to be specified (example code):

void adc_read( int address, int bytes ){
digitalWrite( CS, LOW );
delay( 1 );
SPI.transfer( READ_ONCE | register ); // Write to the com register, specifiying the register to read
digitalWrite( CS, HIGH ); // Toggle the CS pin. Does not seem to work without this. Either outputs garbage, or skips a single bit.
delay( 1 );
digitalWrite( CS, LOW );
delay( 1 );
for( int i = 0; ibytes; i++){
Serial.print( SPI.transfer( 0x00 ), BIN );
}
digitalWrite( CS, HIGH );
delay(1); // Pause to stop next read or write occurring to early
}

3) On internal zero or full scale calibration, if I only wait on the RDY pin ( as in the pseudo code examples of the datasheet ) the AD7730 does not always assert RDY LOW ( probably does not manage to calibrate ), and you can't move on

4) Once successfully into continuous reading mode, an interrupt attached to RDY pin will fire (and read the data register ) extremely frequently for a couple of seconds, and then the RDY pin stops being asserted (the AD7730 stops continuous update of the register? ).

5) I can't seem to work out whether continuous conversion in the Mode register, and Read continuous to the communications register are intrinsically linked, or whether you should be able to set continuous conversion, and perform single readings (which would make sense).