Menu

ZVTools + ZPIK

2021-06-15
2021-06-16
  • Bogdan Zavate

    Bogdan Zavate - 2021-06-15

    Hello guys
    First of all I would like to thank all the team that develop this compiler, I found it not long ago and I think is a great tool to use for programming PIC Micros. I work with them for more than 10 years, and in the past month I was looking for an open-sorce/free compiler that I can use for a new project.
    In a few words: I design some small development boards named ZPIK, with variants for 8pin, 14pin, 20pin, 28pin micros(models with more pins in future). The nice thing about many PIC is that they are pin compatible and I can fit whatever model on the same board 16F or 18F. There will be 2 PC apps , one is a simple bootloader tool for uploading hex files to boards via serial (interface will be separated from the board on simple models) no matter what IDE would be used to produce that hex, and a 2-nd app is more complex, named ZVTools - it is a configurator with many futures: code assistant, code snippets, register setup, PPS selector, utils like timer calculators, baud rates calculator etc, help hints, a core with low-level libraries, a library manager for other specific libraries etc. There is still some work to be done for this app, but basic functionalities are allready implemented. This tool is not an editor, it will only generate some code that you can copy/paste in an editor to organize the code, specify the file path from the editor, and with a single push of button it will compile the source and upload it on the board ( a hex file will not be generated or kept on hard drive ). But user can copy the code somewhere else (like GCB IDE) , and with a few workarounds it can generate the hex file, no problem.
    All libraries will be open-souce , except the bootloader. Why this? Because I have a big problem with China and factories that can take your project and clone it at a cheap price ( see Arduino clone boards phenomenon ) .
    So I would like to hear your opinion on this, about the bootloader not being free, or if you see any problems with this approach in using the GCB compiler.

     

    Last edit: Bogdan Zavate 2021-06-15
  • Anobium

    Anobium - 2021-06-16

    @Bogdan - exciting. This sounds all very doable. I can think of nothing that would prevent this project from working.

    Choose your parts carefully. Ensure they have PROGMEM and EEPROM (not PROGMEM and no EEPROM).

    This project is very similar to PICAXE. So, I would recommend you do PICAXE market research.

    Re the bootloader - use TinyBootLoader ( we manage that also). But, I am not sure what the bootloader is protecting.

     
  • Bogdan Zavate

    Bogdan Zavate - 2021-06-16

    For the first release I intend to use some 16F models from 16F153xx family , 16F183xx family with EEPROM, also 16F18857, 16F18877. An option would be the 16F152xx family, for the cheap price. PIC18F models later. I can not think of other 16F better options.
    My bootloader is done and tested, it fits in 512Kwords BootBlock section (protected), so the approach is different from the TinyBootloader. The bootloaderapp tool will check the hex file for correct code offset, and will discard configuration bits ( config write is protected anyway). I tested the bootloader with MPLABX hex generated code (with offset) and all works fine, interrupts are correctly remapped. In this way the boards can be programmed with any IDE+Compiler that can generate a hex file with code offset ( starting from 0x200 word flash address on 16F chips ). Of course XC8 compiler generated code size is big, and this is where GCB compiler comes in. I will update this post when I have news.

     
  • Anobium

    Anobium - 2021-06-16

    For the first release I intend to use some 16F models from 16F153xx family , 16F183xx family with EEPROM, also 16F18857, 16F18877. An option would be the 16F152xx family, for the cheap price. PIC18F models later. I can not think of other 16F better options.

    All good choices.

    My bootloader is done and tested, it fits in 512Kwords BootBlock section (protected), so the approach is different from the TinyBootloader. The bootloaderapp tool will check the hex file for correct code offset, and will discard configuration bits ( config write is protected anyway).

    TinyBootloader does all that in sub 100words.

    I tested the bootloader with MPLABX hex generated code (with offset) and all works fine, interrupts are correctly remapped. In this way the boards can be programmed with any IDE+Compiler that can generate a hex file with code offset ( starting from 0x200 word flash address on 16F chips ). Of course XC8 compiler generated code size is big, and this is where GCB compiler comes in. I will update this post when I have news.

    TinyBootloader works with Great Cow BASIC and MPLAB-X and many other compilers with no changes to the offsets.

    I recommend you look at the TinyBootloader again.

     
    • Bogdan Zavate

      Bogdan Zavate - 2021-06-16

      I am well aware of TinyBootloader, especially it was developer by a romanian ( I am also from Romania ). The thing is I prefer MAP options from security and code protection reason , BOOT BLOCK + APLICATION BLOCK + SAF . The BOOT BLOCK is write protected, so if a user mistake some address pointers of flash write( for example in SAF area), BOOT BLOCK is unaffected by a possible miswritten pointer . Otherwise the product will become unusable and bootloader must be reprogramed by ICSP again. You can't go on the market to compete with Arduino boards like that. It would be nice to have a selectable BOOT BLOCK of only 256 words, that would be enough for my bootloader also., but we use what options we have. Also if someone tries to hack the application code, it would be impossible to do it with WRTC=0, WRTB=0 and CP=0.

       
      • Anobium

        Anobium - 2021-06-16

        All possible in TBL. We have totally re-written the source and you cannot set any config with ease.

        We are currently porting the TBL to PIC-AS which will remove the dependency on MPASM. I am in discussions with Microchip to include TBL as a bootloader option in MPLAB-X (as we now support PIC-AS).

        And, you can protect the bootloader (dependent on chip) by using SAF protect. And, in your product do not include the self-write methods.

        Your call what to use. :-)

         

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.