"...reaches 11, portb.1 goes high. Now it goes low until variable 126 is reached and goes high.."
Could you be more specific at Value=11 ?
How long to make it high then low again?
------------
"...reaches 11, portb.1 goes high. Now it goes low until variable 126 is reached and goes high.."
Could you be more specific at Value=11 ?
How long to make it high then low again?
------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
May be you need something like:
if my_var=11 then portb.1=1
if my_var=129 then portb.1=0
Ioannis
Select case?
or maybe you want something running in background? if so, set a timer interrupt the do the Select Case and PORTB=x in the ISR.
That's usually how i handle my pushbuttons...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks for the replies guys. I've gone a little further, simplified things and had success. The variable 0 - 1199 is the address lines in an ISD5008 voice record chip. I've programmed it to record and count the individual messages recorded. When played back, it performs a message cue and plays back only the number of messages recorded and returns the address to 0. So if you record 5 messages it will only playback those 5 messages. While you are recording, if portb.0 = 1, it sets the flag to make PORTC.6 high during playback on that particular message. I put a gosub to write MESSAGESRECORDED into eeprom. Upon playback it reads the eeprom locations and IF MESSAGESRECORDED = MESSAGESPLAYED THEN HIGH PORT.6. So if I flag message 5, upon playback if it reads a 5 during playback of message 5 it will go high. I have 59 unused eeprom locations in my 16F872 so I can flag up to 59 messages to make PORTC.6 high. After playing the message it then returns to START and makes PORTC.6 low again. I just read my original post and apologize for being so vague.
peterdeco1,
If it is not too much to request, could you pls post the schematic and the working code?
-----------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks