| 
	
	|  |  |  
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| IDK 
 
 
 Joined: 29 Jan 2019
 Posts: 6
 Location: Pakistan
 
 
			    
 
 | 
			
				| Differential pressure communication library |  
				|  Posted: Sat Sep 26, 2020 5:01 am |   |  
				| 
 |  
				| I am want to interface pic 18f46k22 with differential pressure SDP510. any tips or help link for guide Thanks. |  |  
		|  |  
		| temtronic 
 
 
 Joined: 01 Jul 2010
 Posts: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sat Sep 26, 2020 5:02 am |   |  
				| 
 |  
				| You should post a link to the exact device you're using.... |  |  
		|  |  
		| IDK 
 
 
 Joined: 29 Jan 2019
 Posts: 6
 Location: Pakistan
 
 
			    
 
 |  |  
		|  |  
		| temtronic 
 
 
 Joined: 01 Jul 2010
 Posts: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sat Sep 26, 2020 5:16 am |   |  
				| 
 |  
				| Ok 1st, most important item is that it's a 3 volt device, so be SURE to runt he PIC on 3 volts !!! 
 2nd, it's an I2C device, so use the I2C functions that CCS supplies.
 
 3rd, sadly there's no chart of I2C commands the device has but a quick look, it appears to have an address of 0x80 for write, 0x81 for read.
 
 I'd go to the 'code library' and download PCM P's 'I2C Scanner' program. Compile/download and run. It will tell you the address of the device. Be sure to have I2C pullups (3k3 should work....)
 
 By using the scanner program 1st, you KNOW the PIC can access the sensor.
 
 Jay
 
 edit. found this, might help...
 https://www.14core.com/wiring-sensirion-i2c-digital-differential-pressure-sensor/
 |  |  
		|  |  
		| Ttelmah 
 
 
 Joined: 11 Mar 2010
 Posts: 19966
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sat Sep 26, 2020 5:56 am |   |  
				| 
 |  
				| That isn't actually the data sheet. That is the product overview sheet. The full data sheet (which includes things like the I2C command sequences
 needed), is at:
 
 <https://docs.rs-online.com/036c/0900766b81568891.pdf>
 
 This from Radio Spares.
 
 A lot is going to depend on how you want to use this. It has two
 fundamentally different ways of operating. The first is a 'single reading'
 mode, the second is a 'continuous' mode. In the single reading mode, you
 have to trigger a reading, wait at least 45mSec, and then read the value.
 The 'continuous' mode supports averaging, or just automatic repeat
 readings. With this mode you have to start the readings, and then can
 read a minimum of 8mSec after this (20mSec preferred).
 If you trigger an I2C read, it'll return NACK, if data is not yet available.
 The device address is 0x4A/0x4B (except in clock stretch modes).
 Beware the data sheet gives this in 7bit format, so *2).....
 The commands are 16bit.
 0x3603 start mass flow averaging
 0x3608 start mass flow repeated
 0x3615 start differential pressure averaging
 0x361E start differential pressure repeated
 0x3FF9 Stop repeated command
 0x3624 single mass flow
 0x3726 single mass flow with clock stretch
 0x362F single diff pressure
 0x372D single diff pressure with clock stretch
 0x0006 soft reset chip (send this to address 0 - CGA).
 0x3677 enter sleep mode
 
 0x367C + 0xE102 double command triggers read of chip ID.
 
 With the 'clock stretch' modes, if you attempt a read before the 45mSec
 for the command to complete, the chip will stretch the clock until data
 is available.
 
 The read command once data is available, returns 9 bytes:
 
 Pressure MSB
 Pressure LSB
 CRC
 Temp MSB
 Temp LSB
 CRC
 Scale factor MSB
 Scale factor LSB
 CRC
 
 You can stop the read at any point by nacking the byte, and sending a stop.
 
 The chip ID does tell you which pressure version you have:
 
 0x03020186 SDP800 - 500Pa
 0x03020A86 SDP810 - 500Pa
 0x03020286  SDP800 - 125Pa
 0x03020B86  SDP810 - 125Pa
 
 The CRC is a CRC-8, with 0xFF seed value, and x8+x5_x5+1
 
 I used one some time ago (commercial code though). It is not hard to drive.
 |  |  
		|  |  
		|  |  
  
	| 
 
 | You cannot post new topics in this forum You cannot reply to topics in this forum
 You cannot edit your posts in this forum
 You cannot delete your posts in this forum
 You cannot vote in polls in this forum
 
 |  
 Powered by phpBB © 2001, 2005 phpBB Group
 
 |