Menu

weird behaviour on PIC16F18875

epy
2020-11-07
2021-01-04
  • epy

    epy - 2020-11-07

    I am using PIC16F18875 pic micro. I faced one weird problem. Bootloader was flashed on the controller and i was using for long time.

    After some time i was facing the issue like controller was not executing the while loop code. I think different address might have loaded like bootloader code address.
    But i also observed that controller is executing application ISR routine.

    i was looking into the issue in different area but later i flashed with PICKIT3 then it starts working as expected.

    but the same code was not working as expected with bootloader.

    This is my observation and can be wrong. but i thought of sharing it.

     
  • Anobium

    Anobium - 2020-11-07

    How are you writing the HEX files? PICKItPlus? If yes. then, please get the very latest parts database as any database before yesterday was incorrectly setting bit 13 of config 1. This could the issue. See https://github.com/Anobium/PICKitPlus/blob/master/R217/PKPlusDeviceFile.dat

     
  • epy

    epy - 2020-11-08

    I am using PICKIT3 and using MPLAB X i am flashing. I had updated my PICKIT3 few days back only.

     
  • Anobium

    Anobium - 2020-11-08

    OK Thanks for the insight.

     
  • epy

    epy - 2020-11-09

    Thank you for your reply. Is this the new bug or i am doing something wrong.
    can we erase memory excluding bootloader before flash?

     
  • Anobium

    Anobium - 2020-11-09

    Sounds like you are not setting the RAM in your variables to zero when you start your user code.

     
  • epy

    epy - 2020-11-09

    I don't do explicitly, but i am assuming compiler does this as a part of startup.
    ( Don't take me wrong) But the same code is working with PICKIT3.
    What care i will have to take while using bootloader.

     
  • Anobium

    Anobium - 2020-11-09

    This may be the incorrect assumption.

    I have been looking into this. Do not assume your key variables are empty. There is an 12 bit bank of variables ( and some chips have a buffer) that will have have data that could be non-zero.

    In the Great Cow BASIC world I have started to add the setting of all the RAM to zero as part of the user code initialisation. I would recommend the same for PIC and AVR.

     
  • Joe Bloggs

    Joe Bloggs - 2021-01-04

    Hi looking for some help please with TMBL+. I have it working fine with an 16f886 via the standard seral lines and have blink running. I would like to change the tx & rx pins and can not work out how. Is there any documentation or a help page that explains this? if the new bootloader generator can do it where can i download it please? I have managed to add the necessary parameters so they show up in the firmware section but not having one of the preset programmers I cant go any further. thanks in advance

     
    • Anobium

      Anobium - 2021-01-04

      Have you set the PPS for TX and operationally for RX? If not, use PPSTool to select the TX and RX PSS assignments.

       
  • Joe Bloggs

    Joe Bloggs - 2021-01-04

    Thanks for the response, I have not. After doing a bit of research I found the pps tool, would i still be able to use it as I am not using GCbasic, my blink code is in standard pic C? Should the pin changes be implemented within the bootloader hex or in the blink code? thanks Oh so many questions :)

     
    • Anobium

      Anobium - 2021-01-04

      PPStool will work using any language. You may have to put ; etc at the end of the line.

      As I do not what bootloader you are using, what the bootloader does ... I cannot comment.

       
  • Joe Bloggs

    Joe Bloggs - 2021-01-04

    multibootloader+ on an 16f886

     
    • Anobium

      Anobium - 2021-01-04

      OK. We are working on a new release of TBL+ as the moment. I am also leading the redevelopment of TBL+/

      So,
      1. update TBL+. Send me a Personal Message and I will share how to get latest version. This will sort the PPS for you. All we need to know it the serial ports you want to use.
      2. Use Great Cow BASIC to blink the LED. As Great Cow BASIC produces real ASM that you can learn from.
      3. See the many 16F188xx demos in the Great Cow BASIC demo folders.

      1. :-) Struggle standard PIC C. :-)
       

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.