View previous topic :: View next topic |
Author |
Message |
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon May 31, 2021 1:01 pm Post subject: |
|
|
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 |
|
|
SZTRAD
Joined: 30 Dec 2019 Posts: 165
|
Posted: Mon May 31, 2021 1:52 pm Post subject: |
|
|
OK
you know everything, and I'm a moron.
Let's close this out.
Do you agree? |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon May 31, 2021 3:21 pm Post subject: |
|
|
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.
Quote: | Let's close this out. |
Ok.
Yes. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5920 Location: Holland
|
Posted: Tue Jun 01, 2021 9:09 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|