Again: What about doing nothing?
Does the device need to do something?
Does the device need to do something?
arcachofo wrote:Again: What about doing nothing?
Does the device need to do something?
Then use the pulse() function.
Yes, it needs to send bit 0 on the bus after 97.5 to 750ms conversion time
arcachofo wrote:
Then use the pulse() function.
It works with any delay you want.It doesn't work with such large delay, I have tried already. It is not a pulse anyway, just delay. The bus is already pulled up by master.
As far as I know is a pulse: drive the line low for some time, then release it.It is not a pulse anyway, just delay
Last edited by arcachofo on Thu May 19, 2022 7:27 pm; edited 1 time in total (Reason for editing : typo)
Convert T [44h]
This command begins a temperature conversion. No further data is required. The temperature conversion will be performed and then the DS18B20 will remain idle. If the bus master issues read time slots following this command, the DS18B20 will output 0 on the bus as long as it is busy making a temperature conversion; it will return a 1 when the temperature conversion is complete. If parasite-powered, the bus master has to enable a strong pullup for a period greater than t conv immediately after issuing this command.
Yes, that's what I understood.I'm trying to solve parasite-powered mode, as that is default.
Ok, by now there is nothing I can do until I see the code.That is over my power to solve and similar stuff. I will also test all on real device further and will be probably able to send all during weekend to cleanup all. Then we will see for next steps.
arcachofo wrote:Ok, by now there is nothing I can do until I see the code.
//Added VDD pin
m_pin[1] = m_Vdd = new Pin( 180, QPoint(-36, 0), id+"-vddPin", 1, this );
m_Vdd->setLabelColor( QColor( 250, 200, 200 ) );
m_Vdd->setLabelText("Vdd");
void Ds18b20::writeRawBit( uint8_t bit )
{
if (bit == 0)
pulse( 5, 80 );
else
pulse( 5, 50 );
}
void Ds18b20::readPowerSupply() // Code B4h : using parasite power? pull down
time???
{
m_parasitePower = m_Vdd->getVolt() == 0; // Should sense rail voltage;
if (m_parasitePower)
writeRawBit(0);
// After this command, wait for reset pulse
m_DeviceIsIdle = false;
}
m_parasitePower = m_Vdd->getVolt() == 0; // Should sense rail voltage;
m_parasitePower = m_Vdd->getVolt() < threshold; // Should sense rail voltage;
m_pin[1] = m_Vdd = new Pin( angle, QPoint( x, y ), id+"-vddPin", 1, this );Also, I would like to move pin on the other side (opposite to DQ), but I have no idea is it possible.
--- # discover_fake_DS18B20.ino
This sketch will test DS18B20 sensors attached to
pin 8 for differences with Maxim Integrated-produced DS18B20
using only functionality documented in the datasheet and in
Maxim Application Note AN4377.
28-54-7F-42-73-00-00-02: ROM ok.
Scratchpad Register: 8A/02/AA/55/FF/FF/0C/10/79
Info only: Scratchpad bytes 2,3,4 (AA/55/FF): not Maxim default values 4B/46/7F.
Scratchpad byte 5 (0xFF): ok.
Scratchpad byte 6 (0x0C): unexpected value. Error.
Scratchpad byte 7 (0x10): ok.
0x4E modifies alarm registers: ok.
0x4E accepts 10 bit resolution: ok.
0x4E preserves reserved bytes: ok.
0x4E accepts 12 bit resolution: ok.
0x4E preserves reserved bytes: ok.
Checking byte 6 upon temperature change: not necessary. Skipped.
--> Sensor appears to be counterfeit based on 1 deviations.
The number of deviations is unexpectedly small.
Please see https://github.com/cpetrich/counterfeit_DS18B20/
to help interpret the result.
Testing a real device will help a lot to know what it's actually doing.I have start some basic tests on the real device. This one I have seems to be a genuine Dallas/Maxim product, not a fake or clone (see projects to detect them).
Quite a surprise was that it detects reset after just 202us delay (changed a bit Arduino OneWire lib reset for test) .
Passive and external power is also detected immediately. requiring no delay for pull up at all...
I will test further the rest of commands in both, parasite and external power and determine related timings. Also, I will possible "borrow" one more sensor from an old working project 24/7 almost a decade and see how it behaves in parasite and non-parasite configurations
arcachofo likes this post
arcachofo likes this post
Go to page : 1, 2, 3
Similar topics
Permissions in this forum:
You cannot reply to topics in this forum