{"id":431,"date":"2007-08-31T09:50:00","date_gmt":"2007-08-30T23:50:00","guid":{"rendered":"http:\/\/new.radio-active.net.au\/web3\/431\/"},"modified":"2014-10-10T12:16:09","modified_gmt":"2014-10-10T01:16:09","slug":"431","status":"publish","type":"post","link":"http:\/\/www.radio-active.net.au\/web3\/431","title":{"rendered":""},"content":{"rendered":"<p>I have been programming PIC18F8720&#8217;s for the last few days. And things have been going OK. But I have been working with some TIMER code, and I did some calculations, and what I found was that the timer was being called a heap more than it should have been. In the example code it was being called 240 times more often. 240 times. <\/p>\n<p><code>TIMER_INIT:<br \/>    PR4 = 195<br \/>    IPR3.3 = 1<br \/>    PIR3.3 = 0<br \/>    T4CON = %01111111<br \/>return<\/code><\/p>\n<p>And then in my main loop I compared PIR3.3 and called the timer handler if it was HIGH. This code was fairly simple<\/p>\n<p><code>LOOP:<br \/>    if PIR3.3 = 1 then GOSUB TIMER_LOOP ' Timer has elapsed. Therefore Do It<br \/>    gosub check_serial<br \/>goto LOOP<\/code><\/p>\n<p>But the code was running a heap more than it should have. I worked out I needed to INIT the timer every time through the TIMER_LOOP. The code below shows the GOSUB. It now works.<\/p>\n<p><code>TIMER_LOOP:<br \/>    Gosub TIMER_INIT<br \/>    TimerCount = TimerCount + 1<br \/>    if timercount > 10 then<br \/>        LED = 1 - LED<br \/>        timercount = 0<br \/>        LCDOUT $FE, $C0, \"Now :\", DEC LED<br \/>    endif<br \/>return<br \/><\/code><\/p>\n<h2>Music: Tina Cousins<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>I have been programming PIC18F8720&#8217;s for the last few days. And things have been going OK. But I have been working with some TIMER code, and I did some calculations, and what I found was that the timer was being &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"http:\/\/www.radio-active.net.au\/web3\/431\">  Read More &raquo;<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s5cfmK-431","_links":{"self":[{"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/posts\/431"}],"collection":[{"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/comments?post=431"}],"version-history":[{"count":0,"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/posts\/431\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/categories?post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.radio-active.net.au\/web3\/wp-json\/wp\/v2\/tags?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}