Menu

I am imprresed by the speed of GCB compiled code

Help
Paul Haug
2017-03-15
2017-03-15
  • Paul Haug

    Paul Haug - 2017-03-15

    I suppose I should post this in the general discussion thread, but I wanted to let those who have greatly helped me. My code is reasonably complete and running, thanks to all of you.
    I wrote a little test snippit, as I was curious as to which ran faster in the attached test, suprise, they ran the same as the o-scope shows. Both executed the pulse at 500 ns.
    First puls is PulseOutInv test
    2nd Pulse is line by line code
    .;--------Set up chip info --------------------------------
    #chip 16F886
    #option explicit
    ;#include "lcd_driver.h"
    #define DtoAClock PORTc.4 'pin 15
    #define DtoADir Portc.5
    'Set port directions
    DIR DtoAClock OUT ;pin 15
    DIR DtoADir OUT ;pin 16
    ;-------------Test loop for pulse------------------------------ ;
    do forever

      PulseOutInv DtoAClock, 0 us  ;try GC Basic code
      ;
      set DtoAClock off  ;pin 15   ;Now try seperate steps
      set DtoAClock on
      ;
        wait 10 us  ;just to seprate pulse pairs
    

    loop

     

    Last edit: Paul Haug 2017-03-15
  • William Roth

    William Roth - 2017-03-15

    And that is with a 16F886 operating at only 8 MHz, You could add a 20 MHz resonator to that chip and then get more than twice the performance

      #chip 16F886,20
       #config OSC = HS
    

    It is always a good practice include the MHz after the chipname as this tell GCB how to correctly calculate the delay times.

     
  • Paul Haug

    Paul Haug - 2017-03-15

    Super suggestion, William. I will do that.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.