Have i found a glitch or not

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

Have i found a glitch or not

Post by goldwingers »

Hi guys,
Can you explain this one If i use the switches macro and connect it to say port A, then add leds component you can connect that to port A also, when you run the prog it works?

Like :-
Variable = "Key"

begin
Loop while 1
Switches macro - using wait while low
decision box ( if Key>0)
Branch
output "Key"
end loop
end

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Goldwingers

The Digital I/O ports were designed as tri state input / output logic. Flowcode takes this into account and makes sure that the Tris registers stay up to date. Eg when reading from the switch the port is configured as an input. When writing to LEDs the port is configured as an output.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Post by Mark »

Hi Benj,

How can I tri-state a port pin in Flowcode? I have in mind the technique used with the PicKit 1 where you can selectively light 16 leds from 4 I/O pins. I have tried this out but it never seemed to work as pins other than active output pins seemed to sink current.

Thanks
Go with the Flow.

User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

Hmmm

Post by goldwingers »

Ok, so going back to my original observation, I can now assume that the resultant circuit was an LED in series with a switch (to ground) and a tee point to the Input of the pic. Once the switch was depressed the LED would come on.. irrespectively that the chip was seemingly there or not.

So am i right in assuming that the software is written around the V2 board switch methodology, with the resistor chain hence making a tri state circuit.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Thats right the Input Output pins assigned by Flowcode are designed for use with our Dev boards and E-block range of hardware. You are also correct that when the pin is configured as an input that when a switch is pressed the LED also switches on. However if the pin is configured as an output the led will not light unless there is a logical 1 in the port register for the pin.

Post Reply