List Info

Thread: Tasks procedures and interval




Tasks procedures and interval
country flaguser name
United States
2008-07-03 04:01:04

Hi all,
I am still looking for an interval routine to be used for serial
communications (not the standard start, 8bit,stop) for the 16F877 under
jal 2.0.( f.e. a sony sytem uses start,5 bits, 2 stops)
I have tried to do something with the Tasks but no result.
I hope there is a background routine for this.
In my seatalk remote I have used a certain value in usec but that
depends on the number of commands to be executed. Try and error!
Who helps?
Cheers
Hans

__._,_.___
.

__,_._,___
Re: Tasks procedures and interval
country flaguser name
United States
2008-07-03 16:03:42

--- In jallist%40yahoogroups.com">jallistyahoogroups.com, "hansvanveldhuizen"
<hansvanveldhuizen...> wrote:
&gt;
> Hi all,
>; I am still looking for an interval routine to be used for serial
> communications (not the standard start, 8bit,stop) for the 16F877
under
> jal 2.0.( f.e. a sony sytem uses start,5 bits, 2 stops)
&gt; I have tried to do something with the Tasks but no result.
> I hope there is a background routine for this.
&gt; In my seatalk remote I have used a certain value in usec but that
> depends on the number of commands to be executed. Try and error!
&gt; Who helps?
&gt; Cheers
&gt; Hans
>;
Here is something I have tried, but not working, please comments:

-- JAL 2.0.4
include 16f877a_bert

pin_d0_direction = output
pin_d1_direction = output
pin_d2_direction = output

-- enable timer 0
option_reg = 0b_0000_0111
tmr0 = 200

-- the actual interrupt routine
procedure init_interval is
intcon = 0b_1010_0000
end procedure

procedure end_interval is
intcon = 0
end procedure

procedure next_interval is
var bit x at intcon:2 --- I had to do this because TOif was not ----
recognised by the compiler
while !x loop end loop
x=0
tmr0 = 200
end procedure

forever loop
-------------------------------------
pin_d0 = low -- to check the leds
pin_d1 = low
pin_d2 = low

delay_1S(1)
pin_d0 = high
pin_d1 = high
pin_d2 = high
-----------------------------------
pin_d0 = low -- something like waiting for a startbit
delay_1S(1)
pin_d0 = high

init_interval

for 5 loop -- now reading the bits
next_interval
pin_d1 = !pin_d1
end loop

end_interval

pin_d1 = 0 ------ now doing something with the received info
delay_1S(1)
pin_d2 = low
delay_1S(1)
pin_d2 = high
delay_1S(1)
end loop

Who puts me on the right trail?
Cheers Hans

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )