Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Config 1WIRE PORT-PIN ?

 
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
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 1136

poland.gif
PostPosted: Fri May 02, 2014 5:25 pm    Post subject: Config 1WIRE PORT-PIN ? Reply with quote

Hello. My friend can`t read DS18B20 on PORTD.0 in ATmega16 (ressistor attached)
Program run on test board on PORTD.7 successfully but don`t work on target board.

PORTD.0 is a RXD for RS232 but nothing is received or send in programm.

In my projects I always config all ports on beginning and set as Input for 1WIRE and its work. Then Config 1WIRE as PIND.0 not PORTD.0
Today I read help file Very Happy and 1WIRE is config as PORT not PIN.

If anyone have experience of that diffrences tell me :D

(BASCOM-AVR version : 2.0.7.7 )
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Fri May 02, 2014 8:48 pm    Post subject: Reply with quote

the official syntax is to use a port but pin is accepted too.
the problem is when you enable rs232 (using $baud, print etc) the tx and rx pins are enabled for rs232.
so when you do not need RX you need to disable it in the uart control register : UCSR0B.7=0 'register name depends on the chip
most chips have an alias named UCR so use : UCR.7=0 to deactivate TX : UCR.6=0

_________________
Mark
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
Page 1 of 1

 
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