Log in

View Full Version : multiple outputs on....



rickvan
- 25th November 2007, 14:36
I am new to programming with picBasic Pro. I have used the parallax version. Here is the trouble I am having....
I want to sequence 2 outputs, triggered by a push button. In words, this is what i want to happen:
if button is pressed
turn on 1st output
wait half a second
turn on 2nd output (1st output must stay on)
wait half a second
turn 2nd output off
wait 3 seconds
turn 1st output off

my coding goes like this:

main:
if portb.6 = 1 then
goto activate
else
high portc.0
endif
goto main

activate:
high portc.0
pause 500
high portc.1
pause 500
low portc.1
pause 3000
low portc.0
goto main
end

it works fine, except portc.0 shuts itself off when i call portc.1 high. I have tried a variety of simple programs, but can only get one output on at a time.
What am I doing wrong? Basic Stamp editor holds the output high until it is instructed to move it low.

Acetronics2
- 25th November 2007, 15:29
Hi, Rick

What processor do you use ???

Alain

rickvan
- 25th November 2007, 15:34
I am using a pic16F690.
Any help will be greatly appreciated.
R

Acetronics2
- 25th November 2007, 16:55
Hi,

First, try to configure PORTC digital pins as you need ... ANSEL = % xxxx xxxx see µChip databook

Try also to define explicitly your I/Os by using TRISx = % xxxx xxxx , I know PbP is supposed to care with that .... but, you'll be SURE of !!!

Alain

PS : no need to "bomb" the forum ... one thread is enough !!!