Menu

Problems with 12F1501 and release v0.95.007

Frank
2016-08-08
2016-08-09
  • Frank

    Frank - 2016-08-08

    Hi!
    At first, the forum search tool link seems not to work (https://sourceforge.net/auth/preferences/) which is linked on this site: http://gcbasic.sourceforge.net/usingforum.html

    I hope that my post is in the right rubric, I am not sure if this is a compiler problem or a wrong chip file...

    I have huge problems wit my PIC12F1501. I use the release v0.95.007 and want to use the PIC with the internal 16MHz oscillator. It seems that the "Wait" command not proper works!

    #chip 12F1501,16
    #config mclr_off, INTOSC , wdt_off
    
    #define Led PORTa.2
    Dir Led Out
    
      Do Forever
         set Led on
         Wait 100 ms
         set Led off
         Wait 100 ms
      Loop
    

    I can see on my scope that the led is about 250 ms on and 250 ms off!
    There is no change when I set the two "Wait" to 1 ms, the led flashes always for 250 ms!!!
    The led doesn't lights anymore when I set the two "Wait" to 500 us!!!
    When I delete the two wait comands, my led flashes for about 280 ns - that seems to be ok for 16MHz...

    What's going on? Can somebody help me?

    (Has somebody experience with setting the internal PWM module of the 12F1501?)

    THANKS A LOT!

    Frank

     
  • Anobium

    Anobium - 2016-08-08

    Hi, please try the following. Add, after the #config command.

        ' SCS INTOSC, IRCF 16MHz_HF 
         OSCCON = 0x7A
    

    Let me know if resolves the clock issue.

     

    Last edit: Anobium 2016-08-08
  • Anobium

    Anobium - 2016-08-08

    And, thank you regarding the broken link. All fixed now. ;-)

     
  • Frank

    Frank - 2016-08-08

    Hi Anobium,

    thanks for your fast response!
    Your OSCCON setting has no effect - the timings are as described above...

    Frank

     
  • Anobium

    Anobium - 2016-08-08

    Please upload , as an attachment , your source and asm.

    You could try 0x78 also. The previous....did not work....:-(

     

    Last edit: Anobium 2016-08-08
  • Frank

    Frank - 2016-08-08

    Hi Anobium,

    there is no change with 0x78. Here is my ASM file as attachment...

    Frank

     

    Last edit: Frank 2016-08-08
  • Frank

    Frank - 2016-08-08

    ...and here is my GCB-file

     
  • Hugh Considine

    Hugh Considine - 2016-08-08

    Hi Frank,

    There was a problem with the chip data file, the RAM locations in the 12F1501.dat file were incorrect, so the compiler wasn't using the right locations to pass the delay length into the delay routine. Please try replacing the 12F1501.dat file you have there with this one, and let us know what happens!

    https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/chipdata/12f1501.dat?format=raw

     
  • Frank

    Frank - 2016-08-09

    THANK YOU VERY, VERY MUCH! :-)

    It't works like a charm!!!

    Frank

     
  • Anobium

    Anobium - 2016-08-09

    Good to hear thank you.

    I will include the revised file in the next release. So, v.0.95.008 or greater will have this file included.

    :-)

     

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.