Can't find bug with timer

General discussion on mikroBasic PRO for AVR.
Post Reply
Author
Message
Petr2023
Posts: 14
Joined: 07 Jun 2023 16:39

Can't find bug with timer

#1 Post by Petr2023 » 07 Jun 2023 16:51

Hi
Sorry for my bad Eng

Can't find bug (compiler or not?)!
It must toggle Port D pins each 400 mseconds.
But each 30 switches it toggle faster then 30 switches smooth and ....

If move this peace of code to timer isr then no bug

How to fix it ?
Please help )

Thank You!

Project in attach.

Code: Select all

main:
.......................................
Wait:
     _tsec_now=Tsec
    If (_tsec_now-_tsec_old>400*msec) Then
       PORTD=not PORTD
       _tsec_old=Tsec
    End If
    GoTo Wait
Attachments
test.zip
(38.2 KiB) Downloaded 15 times

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Can't find bug with timer

#2 Post by filip » 14 Jun 2023 11:41

Hi,

I believe that you have solved this issue here :
viewtopic.php?f=81&t=80037

Regards,
Filip.

Petr2023
Posts: 14
Joined: 07 Jun 2023 16:39

Re: Can't find bug with timer

#3 Post by Petr2023 » 14 Jun 2023 11:47

filip wrote:
14 Jun 2023 11:41
Hi,

I believe that you have solved this issue here :
viewtopic.php?f=81&t=80037

Regards,
Filip.
Yes, Tnank You.

Please help viewtopic.php?f=81&t=80043 :)

Post Reply

Return to “mikroBasic PRO for AVR General”