I can create reading/writing temp. but that is not enough to support multiple devices on the same line..
No, it's not implemented because there is no component using it.truly 1-Wire protocol is not implemented at all?
You need to implement 1-Wire protocol in your component.Protocol must exists, to support several commands and several devices. That is not possible currently, as ROM of the device must be read for identification
DHT22 uses a custom 1 wire protocol.I can hardly do that, as I have no deeper insight in your software.
Implementing communication is quite simple:Implementing bit-banging protocol in your software is not in my power.
As far as I know that is what the Master does.Unfortunately, 1-Wire protocol it is much more complicated than that...
If and when you can do it, it is entirely on you. Basic sequence:
- Enumerate devices
- Search devices
- Read ROM
- Sending command and receiving data
#include "ds18b20.h" // Add this line
addItem( Dht22::libraryItem() );
addItem( DS1621::libraryItem() );
addItem( Ds18b20::libraryItem() ); // Add this line
Last edited by arcachofo on Tue Apr 26, 2022 12:53 pm; edited 2 times in total (Reason for editing : Add attachment)
Yes, that was the problem.The simulator read something, but not correctly. I believe bits are mirrored (should be read LSB to MSB, not MSB to LSB)
No.You will then continue on this to add rest?
Can you define the problem?But first, please fix that problem with sending data.
Is that command implemented?E.g. execute "Read ROM" command (33h). Nothing is sent or just one byte with 00h
Is executed when you call it.Also look at byteSent(), it is never executed
That's what you have to implement.or just for one byte, instead all 8 bytes
Sorry I didn't realize.Well, I did and I have sent you all with examples yesterday...
/// Code: 33h
/// If there is only one device on the bus, no need for search ROM procedure
/// Master demands ROM address of it
for(int i=0; i<8; i++)
You need to send one byte.And the way to do that properly is?
This is not specific for simulide.I have told you that I have no deeper insight in your software.
As I understand this is not critical by now.And for instance, temperature reading in real device (command 44h) last 750ms max (for 12-bit resolution). How to accomplish that here, not to affect overall performance?
arcachofo likes this post
Permissions in this forum:
You cannot reply to topics in this forum