Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

probleme sur bit1 du portD atmega823P
Goto page Previous  1, 2
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Mon May 31, 2021 1:01 pm    Post subject: Reply with quote

SZTRAD wrote:
there you can see why PIND is set.

Let me summarize: You was not able to solve the TO's problem, your hints were off-target, instead the TO solved it himself, but asked:
Quote:
Would this line be enough to switch PD1 to TXD output?

Instead of answering that "$baud = 19200' creates code, which enables the USART-unit, overrides the TX DDR-pin and any normal usage of the port pin, you wrote:
Quote:
Yes, it sets PIND.1 to log.1 in the registry.

which was again off-target, or let's rather say 'nonsense', because the direct effect is, that DDRD.1 is set and the portpin is connected to the USART-unit, regular pin functionality is overridden.
The PIN-register has no use for the USART and even if it would be altered thereby as a side effect, I do not understand the value of this discussion and your zealousness.
Back to top
View user's profile
SZTRAD

Bascom Member



Joined: 30 Dec 2019
Posts: 165

blank.gif
PostPosted: Mon May 31, 2021 1:52 pm    Post subject: Reply with quote

OK
you know everything, and I'm a moron.
Let's close this out.
Do you agree?
Back to top
View user's profile
MWS

Bascom Member



Joined: 22 Aug 2009
Posts: 2262

blank.gif
PostPosted: Mon May 31, 2021 3:21 pm    Post subject: Reply with quote

SZTRAD wrote:
you know everything, and I'm a moron.

Surly not. Not the one, not the other.
I'm wondering why you are so inflexible if you get something incorrect.
Happens to anyone of us, but staying stubborn invites others to bring it to the point.
I brought it there, a bit rougher than initially intended.
Not sorry for that, as I took it as the story developed.
No bad sentiments about you, a forum is no real life. Wink
Quote:
Let's close this out.

Ok.
Quote:
Do you agree?

Yes.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Tue Jun 01, 2021 9:09 am    Post subject: Reply with quote

Quote:
You don't change it, Mark, it's a HW thing.It comes from the log AND register of the UART
I will try to find the schematic that was sent to me by Atmel once,there you can see why PIND is set.


I know you are expert with many different electronics. So maybe you confused this with a different processor family. It can also be the case that the translation does not work out. I know from 25 years of experience that it is hard.
I do not know what this log is. I never encountered it with the AVR. maybe you mean that it is a multiplexer like found in xtiny?

I know that some processors have special port logic. Writing to PINx will toggle the PORTx register. The bascom TOGGLE statement use this when possible. Otherwise it has to do a read/modify/write. And some other like xmega have a special toggle register.
So maybe some processors have the side effect that when you write to DDR, it also has an effect on PIN.
But normally and by default, you should never write to PIN register. And when you set DDR it will effect the reading of the PIN depending on the state of the PORT pin and the connected hardware.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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