-
Newbie level 5
mplab logic analyzer
Hi friends,
I've a question for you,certainly....a stupid question,but for me is very hard... :(
I've begin to study PIC with the help of some books and Internet.
I've made a simply short routine for PIC 16F84A with a 4 MHz XTAL in pic_basic (Micro Code Studio) that simulate a button on portb.1 and a led on portb.2.
When the portb.1 is pressed the led must switch on.
I've assemble it with MPASM and there is no errors.
I've created a PRJ with MPLAB IDE 7.30,created a stim_file for portb.1(fire low and fire high),and open the LOGIC ANALYZER to view what happened to portb.2 when fire the portb.1 low or high.
With my surprise the levels of the ports change ONLY when:
click on the animate button,fire the level ,and push on the reset button.
It is possible to syncronize all togheter,like to trigger the fire stimulus file with the logic analyzer,without press all the time the RESET button to look what happens?
I'll upload the diagram in bmp and below I'll show you the file_bas_listing.
Thank you for now.
Stex
File_bas
TRISB = %11111011
'ONLY B2 IS output
'interruptor is b.1
Symbol interruptor = PORTB.1
'led on b.2
Symbol led = PORTB.2
'pippo is a var for a cicle for/next
pippo var Word
begin:
If interruptor = 0 Then Goto dwn
If iinterruptor = 1 Then Goto up
dwn:
Low led
Goto begin
up:
High led
For pippo = 0 To 1
Next pippo
Goto begin
End
PS:Sorry for my bad english ! :)
the diagram below:
-
Banned
Achievements:
logic analyzer mplab
its all down to timing
your time vecter for the low to high transition
is too small compaired to the clocking of the cores instructions
to get a first timing you should take the switching time string
made up of additive varients used withing the core
this is inline timing
but pic uses its own timers
so you must make the whole control -> switching system time
and relative to the time for a single instruction to be processed
and the interrupt systems and clocks pics use and reuse
basicaly blocks of processes that complete as given blocks..
but still inline
therefore time as vecter of instime* proccess ins cycles used
a 'vecter is a bisquare quantus of relivence '
then pic calculates to the whole or by part 'models' timings .....+ routines timings
as a vecter of the clock
so 4 / clock = single ins time in a pic in us {micro seconds}
for a pic 84 running at 4mhz
the single ins time is 4/4 = 1 or 1us per instruction processed
a nop no operation uses 1 ins
an if uses 2
an else 3 + ~1 if the else has another else
etc
so add the time
to get the right vecters on your ourput pulse
or it wont work past the port transition times of the code your using
becouse you inc no delay in your inline single cycle code
-
Newbie level 5
mplab logic analyser
Thank you VSMVDD for the info,but tell me please how it is possible.
Where I can set the time_interval?
stex