Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 48 of 48

Thread: Strange behavior on the Onewireslave library

  1. #26
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    ATM I try to get an Slave working full interrupt based (Arduino style) but with less results...
    Last edited by Markus_L811; 04-15-2015 at 07:56 PM.

  2. #27
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    Need a scope. Did the other example also didn't work?

    Lookd like DS18B20_Slave_Interrupt_universal_analogread works atm don't know why the other not
    Same result...

  3. #28
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    With the 1.6.3/1.22 IDE and the Teensy 3.1 it does

  4. #29
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Quote Originally Posted by jimmayhugh View Post
    I used your DS18B20_Slave_Interrupt_T3 example using a Teensy3.0 as a base. I'm using pin 9 as the dsslavepin.
    With the 1.0.6/1.22 IDE, the code compiles and communicates just fine.
    Attachment 4071
    With the 1.6.3/1.22 IDE the code compiles, but seems to get stuck sending a stream of presence pulses.
    Attachment 4072
    So I find my Teensy 3.0, sad but true it doesn't work, so the Teensy 3.0 and 3.1 share the same Direct I/O defines and the teensyduino is also the same, the guys from Arduino have, had changed something that only affect the Teensy 3.0 what is a little bit strange

    Update:
    Same for all speeds of the Teensy 3.0
    Also it doesn't work well on different speeds on the Teensy 3.1

    Btw. Paul are there any differences in the files or the compiler that write in the IDE Versions?
    Last edited by Markus_L811; 04-11-2015 at 10:34 PM.

  5. #30
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    With the 1.6.3/1.22 IDE and the Teensy 3.1 it does
    You are correct, V1.63/1.22 does compile and operate correctly with the Teensy3.1, but not the Teensy3.0 or Teensy-LC

  6. #31
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    So jimmayhugh lets take the facts together:

    1.0.6/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working..................yes..................???. ..................???

    1.6.3/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working..................no....................yes ...................no

    I'm out of town this week, jimmayhugh can you confirm the rest? And did older versions work on it, may I have make something wrong.

    So may we can find out whats going on!?
    Last edited by Markus_L811; 04-15-2015 at 06:41 PM.

  7. #32
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    So jimmayhugh lets take the facts together:

    1.0.6/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working..................yes..................???. ..................???

    1.6.3/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working..................no....................yes ...................no

    I'm out of town this week, jimmayhugh can you confirm the rest? And did older versions work on it, may I have make something wrong.

    So may we can find out whats going on!?
    Using your OneWireSlave.zip from here, and your DS18B20_Slave_Interrupt_universal_analogread.ino example, wlth pin 9 as dsslavepin, here are the results:

    1.0.6/1.20 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working................YES..................YES...................N/A

    1.0.6/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working.................NO..................NO.....................NO

    1.6.3/1.22 IDE
    ...........................T3.0.................T3 .1.................T-LC
    working.................NO..................YES....................NO

  8. #33
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Thanks for the detailed answer.

    In post #24 you say 1.0.6/1.22 IDE works with the Teensy 3.0, now you mention no for it.

    May I'm a little bit cheeky but I think Paul changed something somewhere but I can not piont a direction where.

  9. #34
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    Thanks for the detailed answer.

    In post #24 you say 1.0.6/1.22 IDE works with the Teensy 3.0, now you mention no for it.

    May I'm a little bit cheeky but I think Paul changed something somewhere but I can not piont a direction where.
    That was a typo, corrected now...

  10. #35
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Think at the moment its a problem somewhere between interrupts (trigger state problems) or the delay (timing problems) function my minimum interrupt based OneWireslave sketch works only as single device may it helps to find the problem. with an search sketch to show only the ID.

    You can test this.
    Attached Files Attached Files
    Last edited by Markus_L811; 04-21-2015 at 07:42 PM. Reason: Updated

  11. #36
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Using your BareMinimum and Dallas_only .ino files (with mods to use the pins I use for the 1-Wire lan), using 1.63/1.22, all three devices respond between 1 and 6 times to the MasterResetPulse before failing to respond further.

    The MasterResetPulse() debug value shows up at 480us +- 2us when they do respond.

  12. #37
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Quote Originally Posted by jimmayhugh View Post
    Using your BareMinimum and Dallas_only .ino files (with mods to use the pins I use for the 1-Wire lan), using 1.63/1.22, all three devices respond between 1 and 6 times to the MasterResetPulse before failing to respond further.

    The MasterResetPulse() debug value shows up at 480us +- 2us when they do respond.
    Yeah I know they work or better said it work very less. But when all devices work (even only 1 time) on an other teensy as an only slave interrupts and delay are working only the option "CHANGE" is used in the function attachinterrupt in the lib instead of changing interrupt options to detect the RESET and other pulses of the Onewire-Bus in the BareMinimum.

    So may the attachinterrupt CHANGE option isn't working well.

  13. #38
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,115
    Compiler optimization flags have changed. Maybe that's causing timing differences?

    When you run these tests, what device is acting as the 1-wire master?

  14. #39
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,115
    Timing may have changed on the master side too.

  15. #40
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    I've managed to get the Teeny3.1 and Teensy3.0 working with the library in 1.63/1.22, with some caveats. It looks like it's a timing issue.
    Both the Teensy3.0 and Teensy3.1 seem to work (so far) at 96Mhz, The Teensy3.1 works at 48Mhz, while the Teensy3.0 does not. I have been unable to get the Teeny-LC to co-operate at all.

    More investigations...

  16. #41
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by PaulStoffregen View Post
    Compiler optimization flags have changed. Maybe that's causing timing differences?

    When you run these tests, what device is acting as the 1-wire master?
    I've got a Teensy3.1 acting as the master.

  17. #42
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    I've got the Teensy-LC responding, it's definitely a timing issue.

    I'm gonna need a few more Teensy-LCs to test my other boards...

    Does the Teensy-LC support the watchdog timer ala the Teensy3.x?
    Last edited by jimmayhugh; 04-24-2015 at 04:25 PM.

  18. #43
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Quote Originally Posted by jimmayhugh View Post
    I've got the Teensy-LC responding, it's definitely a timing issue.

    I'm gonna need a few more Teensy-LCs to test my other boards...

    Does the Teensy-LC support the watchdog timer ala the Teensy3.x?
    Can you show me what you did, I think my Teensy LC has arrived get a message about a packet

  19. #44
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Yes my Teensy-LC arrived

  20. #45
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    Can you show me what you did, I think my Teensy LC has arrived get a message about a packet
    Here's a zip file of the .cpp and .h OneWireSlave library files as I've modified them.
    OneWireSlave.zip

    I've also got it at my github.

    I've done a relatively minor amount of testing, but they seem to work alongside real MAXIM devices, such as the DS 18B20 and DS2406+.
    Last edited by jimmayhugh; 04-24-2015 at 09:36 PM.

  21. #46
    Senior Member
    Join Date
    Apr 2013
    Posts
    154
    Quote Originally Posted by jimmayhugh View Post
    Here's a zip file of the .cpp and .h OneWireSlave library files as I've modified them.
    OneWireSlave.zip

    I've also got it at my github.

    I've done a relatively minor amount of testing, but they seem to work alongside real MAXIM devices, such as the DS 18B20 and DS2406+.

    Good to see, will look at your changes what Value did you use as Pullup-Resistor?

  22. #47
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    Quote Originally Posted by Markus_L811 View Post
    Good to see, will look at your changes what Value did you use as Pullup-Resistor?
    I use a simple level shifter circuit consisting of two N-channel MOSFETs and two 10K resistors to convert the TeensyX 3.3v signals to 5v for the mini-lan.

    Click image for larger version. 

Name:	TeensyNetLevelConverter.png 
Views:	166 
Size:	21.6 KB 
ID:	4153
    I have the option to include a 4k7 resistor on all of the boards, but rarely use it.

  23. #48
    Hi Guys,

    I'm also trying to build a 1-Wire Slave device to emulate a temperature sensor, which will actually get the temperature from a PID Temperature Controller via an RS485 link.

    However, this is my first T 3.1 project and so I'm wondering how you guys have interfaced the 1-wire data line to the T 3.1 as I've never used one before and so I'm not real sure about the 3.3v and 5V tolerant inputs and how that affects the 1-Wire interface.

    My 1-wire master is a LinkUSB 1-Wire USB adaptor connected to a Linux VM running Ubuntu and OWFS.

    Regards

    Alex Shepherd

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •