View previous topic :: View next topic |
Author |
Message |
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Wed Jan 16, 2013 7:20 pm Post subject: |
|
|
Ld r17,Z ; get PIN register
change to
Lds r17,PINF
there is this cmd 2 times
if you can't get it working send me a mail and I sent the lbx file to you
farmtech@has.dk _________________ / Kim |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed Jan 16, 2013 9:33 pm Post subject: |
|
|
because the lib is included at a different point you need to change :
Rcall _1wire_set_pin ; some common cod
into
call _1wire_set_pin ; some common cod
that should solve it.
@kimmi
if the lib is working, please send it so i can include it , it might be interesting for other users. _________________ Mark |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Wed Jan 16, 2013 9:49 pm Post subject: |
|
|
Hi Mark,
I have sent the lib now _________________ / Kim |
|
Back to top |
|
|
nisse
Joined: 14 Dec 2006 Posts: 50
|
Posted: Thu Jan 17, 2013 2:28 pm Post subject: |
|
|
Looks like there might be a problem with the lib in combination with AVR-DOS
This row in my program:
Open FileName For append As #Ffh
Generates a compile time error: Backward Jump out of range in _1wire_search_next
If I rem that row, the program compiles.
/Andy |
|
Back to top |
|
|
nisse
Joined: 14 Dec 2006 Posts: 50
|
Posted: Thu Jan 17, 2013 3:23 pm Post subject: |
|
|
You can see the problem with this sample program:
$regfile = "m128def.DAT"
$baud = 115200
$baud1 = 115200
$crystal = 14745600
$hwstack = 128 ' hardware stack
$swstack = 128 ' SW stack
$framesize = 128 ' frame space
Set Mcucsr.jtd 'Disable JTAG
Set Mcucsr.jtd
$lib "M128-1wire-PortF_3.LBX"
config 1wire = pinf.6 , extended = 1
$include "config_mmcsd_hc.bas"
$include "CONFIG_AVR-DOS.bas"
Dim Ffh As Byte , Filename as string * 12
Filename = "test.txt"
Ffh = Freefile()
Open FileName For append As #ffh 'PROBLEM
close #ffh
1wverify TempSensorID(1) 'PROBLEM
This will generate a compile time error unless you rem either the Open Filename... row or the 1wverify... row
/Andy |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jan 17, 2013 4:55 pm Post subject: |
|
|
the solution was to add the other 1wire routines as well.
I will include the lib with the next update for others that might want to use it. _________________ Mark |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Jan 17, 2013 4:58 pm Post subject: |
|
|
and what i forgot : extend=1 should be removed. extended is only for ports with an address of &H100 or higher. Xmega excluded since that is handled different anyway.
and also : when you use the special lib, you can not use 1wire on another port. this special lib is only for m128 portF. _________________ Mark |
|
Back to top |
|
|
sp3swj
Joined: 02 Jan 2009 Posts: 14
|
Posted: Wed Oct 08, 2014 1:12 am Post subject: |
|
|
Is planned any update of current HELP and WIKI with this info ? ... and LIB to download - becouse in my lates 2-0-7-7 instalation lib is missing |
|
Back to top |
|
|
|