Reading parallel IOs

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Reading parallel IOs

Post by YahooArchive »

>I have a need to read 8 digital inputs, and flag if any have changed since last
time.

>Reading individually takes too long.
>I've been digging through theLPC Users Guide - Seems like I should be able to
read all 8bits in 1 shot using GPIO as in LogicScope? But I don't yet see how
the Pro IO numbers map into GPIO bits?

The mapping has been added to the Help files Pin diagram pages for the ARMmite
and PRO baords (it would also show up on the schematic diagrams)

All 32 IOs can be read by reading the FIOPIN register (&H3FFFC014, fast IOs are
used) and then you can mask the bits you are interested in.

As you mention this is done in the LogicScope.bas and ScopeDemo. I checked this
AM and it has not been updated since the firmware switched to using the Fast IOs
over the GPIO. So it was not working, it has been fixed and will be posted
later today.

In LogicScope.bas the mask and trigger will set up conditions to trigger the
trace. The demo set them both to 0, mask no bits, and trigger on anything. You
can select bits to trigger on with mask and the trigger condition, and the trace
will start when the following is true (from LogicScope.bas)

if ScopeMask then
while (*FIOPIN AND ScopeMask) <> ScopeTrigger
loop
endif



Post Reply