Page 1 of 1
Have i found a glitch or not
Posted: Thu Jan 04, 2007 9:56 pm
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
Posted: Fri Jan 05, 2007 10:43 am
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.
Posted: Fri Jan 05, 2007 11:52 am
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
Hmmm
Posted: Sat Jan 06, 2007 11:45 am
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.
Posted: Mon Jan 08, 2007 10:25 am
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.