Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

1wire on extended port not working
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Wed Jan 16, 2013 7:20 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website MSN Messenger
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Wed Jan 16, 2013 9:33 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Wed Jan 16, 2013 9:49 pm    Post subject: Reply with quote

Hi Mark,

I have sent the lib now

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
nisse

Bascom Member



Joined: 14 Dec 2006
Posts: 50

sweden.gif
PostPosted: Thu Jan 17, 2013 2:28 pm    Post subject: Reply with quote

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
View user's profile
nisse

Bascom Member



Joined: 14 Dec 2006
Posts: 50

sweden.gif
PostPosted: Thu Jan 17, 2013 3:23 pm    Post subject: Reply with quote

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
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Thu Jan 17, 2013 4:55 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Thu Jan 17, 2013 4:58 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
sp3swj

Bascom Member



Joined: 02 Jan 2009
Posts: 14

poland.gif
PostPosted: Wed Oct 08, 2014 1:12 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum