M-o-a-T / owslave

Master code for slave devices
GNU General Public License v3.0
18 stars 7 forks source link

Issue with current version and attiny85 mcu #13

Open nbernard opened 8 years ago

nbernard commented 8 years ago

Hi,

I'm trying to use owslave on an attiny85 (that is marked as "untested for some time") and I'm running into some issues.

Mostly the current head doesn't compile for this device. I have tried using older versions, but then I run into different compilation errors due to the evolution of some dependencies since. It seems the main culprit is around commit e96137693c67eeae281dfcf72068734c36508ffd, and I tried the following modifications:

diff --git a/cfg b/cfg
index d84d19d..4287de7 100755
--- a/cfg
+++ b/cfg
@@ -423,8 +423,9 @@ def main(cfg_name,*kk):
                             print("#define ONEWIRE_IFBIT {}".format(1<<(-own-1)), file=f)
                         else:
                             print("#define ONEWIRE_IRQ PCINT{}_vect".format(own+int(owp[1])), file=f)
-                            print("#define ONEWIRE_IFR PCICR", file=f)
+                            print("#define ONEWIRE_IER PCICR", file=f)
                             print("#define ONEWIRE_IFR PCINT{}".format(own>>3), file=f)
+                            print("#define ONEWIRE_IFBIT 0", file=f)

                     if temp_nam:
                         print("#define N_TEMP_DRIVER {}".format(len(temp_nam)), file=f)
diff --git a/irq_catcher.c b/irq_catcher.c
index 1f6b837..2854c9f 100644
--- a/irq_catcher.c
+++ b/irq_catcher.c
@@ -100,7 +100,7 @@ void __vector_2(void) { ping_me(2); }
 #endif
 void __vector_3(void) { ping_me(3); }
 void __vector_4(void) { ping_me(4); }
-void __vector_5(void) { ping_me(5); }
+//void __vector_5(void) { ping_me(5); }
 void __vector_6(void) { ping_me(6); }
 void __vector_7(void) { ping_me(7); }
 void __vector_8(void) { ping_me(8); }
diff --git a/world.cfg b/world.cfg
index 92abe68..45c9ff9 100644
--- a/world.cfg
+++ b/world.cfg
@@ -187,9 +188,11 @@ mcu:
     mcu: attiny85
     flash:
       size: 8
+    pin_irq:
+      B2: -1
     prog: t85
     defs:
-      onewire_io: B1
+      onewire_io: B2
   mega8:
     mcu: atmega8
     prog: m8

and the following configuration file:

_include: world.cfg
devices:
  _default:
    _ref: defaults.target.t85
    types:
      _ref: defaults.types
    code: []
  test_1:
    _doc: My very first 1wire slave device
    mcu: attiny85
    defs:
      is_onewire: ds2423
#      is_onewire: moat
      use_eeprom: 1
      single_device: 1
      have_irq_catcher: 1
    onewire_id: xdeadbeef0000
targets:
- test_1

With these modifications, the build is successful, but the flashed mcu appears unresponsive to a 1-wire query, so I guess they are incomplete and/or erroneous. I tried both the ds2423 (as, if I succeed in making this to work, I may try to implement the now obsolete ds2433) and the moat targets, with the same (non-)result.

Would you have any idea/advice?

drtrigon commented 7 years ago

@nbernard: I've been run into similar issues. Have you been able to make the slave device working/functional?

nbernard commented 7 years ago

Hello,

No, I have not, but I didn't try hard yet either. I have put this project on the backburner while waiting to see if someone had an easy fix, and due to other more pressing projects, have not touched it since.