Hi all!
I need your qualified help! I'm programing in C++, using a PIC 18F87J50 and trying to connect DS18B20 at my H0 Port!
I think my underlying programing is correct so.... the problem I have (think I have), is when performing a ROM Command, I'm searching for the 64-bit ROM CODE.
The first byte should tell me what family the component belongs to (28h). The next 48 bits should give me a uniq serial for just that component. The last one is used for a CRC.
Am I thinking right when doing like this:
void Device_ID( uint8_t command ){
uint8_t ROM_CODE[8]; // 1 byte CRC, 6 bytes SERIAL, 1 byte Family code
uint8_t loop;
static char container[8];
OW_reset_pulse();
OW_write_byte( command );
for(loop = 0; loop < 8; loop++) // 1 byte in per time = 64-bits
{
ROM_CODE[loop] = OW_read_byte();
}
HexToStrWithZeros(ROM_CODE[0], container);
Display_Cls();
Display_StringAt ("Family Code: ",5,6);
Display_Buffer (container);
}
If I ask for the code in ROM_CODE[1-6] I should get the uniq number?? should'nt I??
Kind Regards!