Steve,
This "something to try" works like a champ!! - thanks much! It is a perfect building block for what I am trying to do.
However, here is a couple of things I can't figure out.
Here is the code as used: (PS I don't use the one line assembly code to set up below. For some reason, I have trouble with it in MSP)
DEFINE OSC 4 '4 MHZ INTERNAL OSCILLATOR
DEFINE OSCAL_1K_1
INTRC_OSC_NOCLKOUT
WDT_ON
PWRTE_ON
MCLRE_ON
BODEN_OFF
GPIO = 0
TRISIO = %00001111
ANSEL = 0
CMCON = 7
LED VAR GPIO.5
PUSHBUTTON VAR GPIO.1
DELAY VAR BYTE
COUNTERA VAR BYTE
MAXCOUNT CON 100
PAUSE 100
START:
IF PUSHBUTTON = 1 THEN
WHILE PUSHBUTTON = 1: WEND
PAUSE 50
GOSUB ROUTINE1
ENDIF
GOTO START
ROUTINE1:
FOR COUNTERA = 0 TO MAXCOUNT
TOGGLE LED
GOSUB DODELAY
NEXT
RETURN
DODELAY:
FOR DELAY = 0 TO 50
PAUSE 10
IF PUSHBUTTON = 1 THEN
WHILE PUSHBUTTON = 1: WEND
PAUSE 50
DELAY = 50
COUNTERA = MAXCOUNT
LED = 0
ENDIF
NEXT
RETURN
Problem is - notice the trisio and what I need is, to push button (gpio.1) to flash gpio.5. The other button (gpio.0) will eventually be set up to flash gpio.4! However, even with the trisio the way it is, the pushbutton flashes ONLY gpio.0. (Can't get it to change to io5) I have erased the chip and reprogrammed several times but will not change.
Secondly, every other time it goes through the routine, the flasher stays on. Can I use, say 99 instead of maxcount in the second routine to trick it into toggling off?
Again, I really appreciate your help. I would not have thought of doing it this way - toooo newbie in this stuff!!!
Ron




Bookmarks