*25.4.1.18 GPIO_DATAOUT Register (offset = 13Ch) [reset = 0h]*

*GPIO_DATAOUT is shown in Figure 25-24 and described in Table 25-23.*

The GPIO_DATAOUT register is used for setting the value of the GPIO output
pins. Data is written to the
GPIO_DATAOUT register synchronously with the interface clock. This register
can be accessed with
direct read/write operations or using the alternate Set/Clear feature. This
feature enables to set or clear
specific bits of this register with a single write access to the set data
output register
(GPIO_SETDATAOUT) or to the clear data output register (GPIO_CLEARDATAOUT)
address.

Ok thats confusing . . .but I guess I read this and understood the opposite
of what it's saying ? e.g. I was thinking DATAOUT would be fast ?

On Thu, Sep 8, 2016 at 1:56 PM, William Hermans <[email protected]> wrote:

> Oh...while we're on the subject, there's one more significant reason
>> the set/clear registers are helpful even if you're not worried about
>> multi-threaded operation:  They're *FAST*
>>
>
> I did notice that it seemed to be that way from your description. But the
> way I read the TRM. TO me it seems that the SETDATA(direction) registers
> actually write to DATAOUT. did I read that wrong ?
>
> On Thu, Sep 8, 2016 at 1:51 PM, Charles Steinkuehler <
> [email protected]> wrote:
>
>> On 9/8/2016 3:35 PM, Charles Steinkuehler wrote:
>> > On 9/8/2016 12:41 PM, William Hermans wrote:
>> >>
>> >> It has long been programing technique to use DATAOUT |= BITx to set a
>> register
>> >> bit DATAOUT &= (~BITx) to clear a register bit, or something like
>> if(DATAOUT &
>> >> BITx){} or if((DATAOUT &BITx) == 0 or 1) to read a bit from a register.
>> >
>> > Yes, it has.  But those short-hand snippits of C code are hiding an
>> > implicit read-modify-write cycle:
>> >
>> > DATAOUT |= BITx
>> >
>> > ...turns into:
>> >
>> > Read  : <temp> = DATAOUT
>> > Modify: <temp> = <temp> | BITx
>> > Write : DATAOUT = <temp>
>> >
>> > ...where <temp> is probably a CPU register (unless your C compiler is
>> > _really_ bad!).  But if you use the set/clear registers it's just:
>> >
>> > Write : SETDATAOUT = BITx
>>
>> Oh...while we're on the subject, there's one more significant reason
>> the set/clear registers are helpful even if you're not worried about
>> multi-threaded operation:  They're *FAST*
>>
>> The ARM core on the BBB is running at 1 GHz, but the I/O is only
>> running at about 100 MHz.  So that simple DATAOUT |= BITx stalls the
>> CPU until the system can provide the current value of DATAOUT to the
>> processor core, which likely takes a couple hundred nanoseconds (based
>> on the time it takes for the PRU to read a GPIO register).
>>
>> The write, however, is very fast (for both the set/clear case and for
>> writing directly to DATAOUT).  Writes are posted and the ARM has weak
>> memory ordering, so as long as you're not saturating the on-chip
>> interconnect fabric, the write will appear to complete instantly, the
>> ARM core will carry on executing instructions, and about 100 nS later
>> the GPIO register will update with the new value once the write
>> transaction has worked it's way through the on-chip interconnect fabric.
>>
>> --
>> Charles Steinkuehler
>> [email protected]
>>
>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/beagleboard/66e45786-85b9-2302-bef4-3213f6848a8d%40steinkuehler.net.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORrCVVmifF_V1KyUFwpGb-X%3D0j8o%3DeGMQwOtXHawK%2Bx-Vg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to