Deutsch   English   Français   Italiano  
<vbv1c9$a8c1$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!npeer.as286.net!dummy01.as286.net!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: The Natural Philosopher <tnp@invalid.invalid>
Newsgroups: sci.electronics.design,comp.sys.raspberry-pi
Subject: Re: uP port mapping
Date: Thu, 12 Sep 2024 16:29:13 +0100
Organization: A little, after lunch
Lines: 45
Message-ID: <vbv1c9$a8c1$2@dont-email.me>
References: <jl51ejh70f9h8cf10pa38t5lhdnhpv4fcg@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 12 Sep 2024 17:29:14 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="82a4803f6dc0412d37da0cdf9898b130";
	logging-data="336257"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19UnZ7qwmi8zjZB5FLATiEDirdVE7Nf2NQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UabPZ7SrbJh/YpCu0GoMRhn4Rxs=
In-Reply-To: <jl51ejh70f9h8cf10pa38t5lhdnhpv4fcg@4ax.com>
Content-Language: en-GB
Bytes: 2656

On 10/09/2024 20:12, john larkin wrote:
> Something I've wondered about:
> 
> Suppose we have a c program running on some little uP, and it has some
> integer variable value, 8 or 12 bits or something, and wants to drive
> a parallel DAC off-chip.
> 
> The msb...lsb bits of the variable obviously have to get to the right
> pins of the DAC.
> 
> So, in general, how does one pick the physical i/o port pins on the
> uP, to get the order right? The PCB layout is easiest if we just wire
> the DAC to the handiest port pins.

TBH once you go to at least 2 layer and dont worry about super small 
size, that isn't very hard. You can use traces with via's as jumpers. 
Once the board is done there is no added cost


Helped by the fact that the PIO pins on the boards go in order IIRC.

> 
> One could test and bit-bang each bit and port individually, and then
> strobe the DAC, but that's inelegant.
> 
Wastes CPU too.

> In the RP2040 chip, one can apparently write to a register in a
> PIO/state machine block, where each bit of the register can be
> assigned to drive a physical port pin. I think there are some
> constraints on the selected pins.

I think so, though I have not found the need to use it.
Obviously for deeply parallel operations that works.  But modern 
practice is to implement some sort of high speed serial bus.
In general that is fast enough for a DAC anyway


-- 
For in reason, all government without the consent of the governed is the 
very definition of slavery.

Jonathan Swift