Menu

16f1829: Tiny & Great Cow basic -- Hex file for PIC18F, PIC family mismatch.

ofuzzy1
2013-09-25
2013-10-04
  • ofuzzy1

    ofuzzy1 - 2013-09-25

    First: Edorul & Dan THANK you for a great product!

    Using the latest version of tiny v081

    Edorul & Dan: See my offer below for some sample PCBs below!

    Fixed it.

    I should of looked closer at word #4 3fff,
    had this in the code:
    ;#option bootloader 2

    ; is not a comment in GCB
    only ' -- single quote is -- dooh!

    This is really cool because now I can program TBL into a pic and hand a student a $2 usb to ttlRS232 and not need a PICKIT2 or 3 to load code into a chip -- that's is really awesome thanks guys for all your effort.
    ebay 5PCS USB To RS232 TTL PL2303HX Auto Converter $8/5pcs

    ------------------
    

    changed the 1823 to 1829

        ; change these lines accordingly to your application    
    #include "p16f1829.inc"
    IdTypePIC = 0x2A        ; Please refer to the table below, must exists in "piccodes.ini"    
    #define max_flash  0x2000   ; in WORDS, not bytes!!! (= 'max flash memory' from "piccodes.ini" divided by 2), Please refer to the table below
    
    #define Erase_Page 32           ; Erase Page          (16/32), Please refer to the table below
    #define PDIP       20       ; PIN Count of Device (8/14/18/20), Please refer to the table below
    
    xtal    EQU     16000000    ; you may also want to change: _HS_OSC _XT_OSC
    baud    EQU     19200       ; standard TinyBld baud rates: 115200 or 19200
    

    getting this error:

    Check Device...
    Open COM10 serial port at 19200bd
       Software reseting Device
       Found: 16F w/8Kw flash & 256B EEPROM (Blk32)
    Open HEX file: C:\750G\projects\pic\1829 lcd hello world.hex
    Error: Hex file for PIC18F, PIC family mismatch.
    Close COM10 serial port
    

    will upload files in a moment

     

    Last edit: ofuzzy1 2013-10-04
  • ofuzzy1

    ofuzzy1 - 2013-09-25

    the GC basic files
    gcb code, list asm hex

    Thanks

    I know it will clobber the Tiny on the upload.

    That is my next question:
    How you tell GCB to make room and to LIMIT the total size.

    16f1829 [@ 0000 = 339F] then the rest is @ at the top 1FA0 [8k-100]
    So now how do I tell the gcb compiler to compile with that?

     

    Last edit: ofuzzy1 2013-09-25
  • ofuzzy1

    ofuzzy1 - 2013-09-25

    Will tiny prevent you from over writing itself? [if you use check file?]

    It will be awesome to not use a pickit for most work.

     
  • ofuzzy1

    ofuzzy1 - 2013-09-26

    anybody? any ideas

     
  • edorul

    edorul - 2013-09-26

    Hello,

    "Error: Hex file for PIC18F, PIC family mismatch." appears because there is a bug in the "check file" procedure in TinyBootloader+ (thanks for the the report).
    But, don't worry, the program transfert will be the same with or without "Check file" option. In fact, "Check file" option is just used to avoid errors like: put a PIC16 firmware in a PIC18 device and wonder why the application doesn't work.

    For Great Cow Basic, you don't have to bother with something like "16f1829 [@ 0000 = 339F]". You just have to write programs sufficiently small to stay in [Max_Mem - 100words].

    Yes, TinyBootloader+ will tell you if it attempts to write itself (no need to check the "check file" option). If it's the case, it won't try to write your program in the PIC.

    Best regards,
    Edorul

     
  • ofuzzy1

    ofuzzy1 - 2013-09-28

    Edorul: Thank YOU so very much for your great work.

    So very glad I could stumble upon an error :)

     
  • ofuzzy1

    ofuzzy1 - 2013-10-03

    Unfortunately, after loading a GCB .hex tinybootloader no longer gets executed.

    Anyone here have a clue on how do I compile in a command to tell gcb to run tiny, which will then return to gcb if no answer from the host.

     
  • ofuzzy1

    ofuzzy1 - 2013-10-03

    here's the handshake info:

    ---------------------------------------------------------
    
    Check Device...
    Open COM10 serial port at 19200bd
       Software reseting Device
       Found: 16F w/8Kw flash & 256B EEPROM (Blk32)
    Close COM10 serial port
    
    ---------------------------------------------------------
    
    Check Device...
    Open COM10 serial port at 19200bd
       Software reseting Device
       Found: 16F w/8Kw flash & 256B EEPROM (Blk32)
    Open HEX file: C:\750G\projects\pic\1829 LCD i2c RTC demo -01.hex
       Warning: Config found just writing data
       Warning: Config found just writing data
       Warning: Config found just writing data
       Warning: Config found just writing data
       WARNING: pclath not fully initialised before GOTO! ... 
       Code sucessfully repaired.
    Transfering flash...
       Transfering program memory...
    Transfert HEX successfull :-)
    Close COM10 serial port
    
    ---------------------------------------------------------
    
    Check Device...
    Open COM10 serial port at 19200bd
       Software reseting Device
       Error: Wrong answer from Device!!!
    Close COM10 serial port
    
    ---------------------------------------------------------
    
     
  • Dan

    Dan - 2013-10-03

    Hello,ofuzzy1

    Checkpoints.

    After writing the user program, please check the following:

    ①Code of bootloader area (0x1FA0 ~ 0x1FFF) has not been changed after writing.

    ②Code of 0x0000 ~ 0002 address is similar to the one below after writing.

    0000:301F movlw 0x1F
    0001:008A movwf PCLATH
    0002:2FA0 goto IntrareBootloader

    There is a possibility that the reset is not applied correctly these is successful.

    Best regards,
    Dan

     
  • ofuzzy1

    ofuzzy1 - 2013-10-03

    Dan, Thanks for the reply.

    If you want I can send you and Edorul a couple pcbs --

    You can pm your snail addresses, Edorul I know you're outside the US.

    I sent a package gcb's Evan & Hugh [via Evan] -- it should arrive soon.

    These projects are for middle school and highschool STEM students.

    My goal is to use GCbasic & Tiny Boot Loarder with a $3 usb to ttlRS232 to program these.

    A Rocket board ---  ~23mm x 9"
        ALL soic and smaller have BIG easy pads to solder
        18f soic-28 2550 ... 26k22 .. 27j53 ...   -- BIG easy pads to solder
        PIC-ISP 1x5pin
        1 set of PORT .1 pins for easy prototyping
    
        mcp 23017 soic-28 -- BIG easy pads to solder
        2 accelerometers [adxl377 200g analog + i2c LS331 ± 6g/±12g/±24g]
                    ADXL337 @ ~$3- 3d 3g analog lil bro to adxl377 @ $11
        i2c Barometer MPL115A2 
        Port for GY-80 10 degree board [magotometer, acclerometer, MPL115A2]
        2 I2c 4 pin
        nRF24L01 2x4pin RFmini board
        uln2801 dip + 6 screw terminal strip [4out + Gnd +Vbat]
        RTC MCP7941X soic8 -- wth backup battery header and side mount for a lithium CR23xx  --BIG easy pads to solder
        RAM/    24Lxx ..24aa  soic8 -- BIG easy pads to solder
        SD Card 2 - microSD Card socket & .1"pin spacing for a "jam-it" - solder a .1 header to 1-8 on a SD to uSD adapter.
        USB mini female socket, a real joy to solder!
        3 micro Push Buttons
    
    16F / 12F Developer Board 1.5" x 3" v1
        PIC-ISP 1x5pin
        DIP-20 Pic, 16f1829, 16f690
        Power pins @ 1 and [8 | 14 | 18 | 20]
        Any 8, 14, 18, 20 pin "new" pinout
            2 set2 of PORT .1 pins for easy prototyping
    
        The Board Features:
        Ports:
        LCD Parrallel 1x16 & 2x8  Hitiachi type
        RS232 [in=a.3 +22kohm software, out=a.0 +1kohm]  + DB9f
        1x1.5" Prototying area
        Other parts: LM7805, LM78L33, 10k trim pot [lcd contrast], xtal, 2.1mm-F power, lots of Jumpers for options
    
    12F Developer Board 1" x 1"
        PIC-ISP 1x5pin
        8 pin Pic, 12f1240, 12f683 ...
        Power pins @ 1 and 8
            2 sets of PORT .1 pins for easy prototyping
        2 sets of proto typing headers 
        All a.0-.5
        OUTput only a.0-2, .4 .5 with a GND bus for LEDs
    
    i2c Expansion
        mcp 23017 soic-28 -- Big easy pads to solder
        2 sets of PORT .1 pins for easy prototyping
    
        I2c 1x4 [v-, V+ sda, scl] -- 2 headers + 1x6  [v-, V+ sda, scl, IRQa, IRQb]
        uln2801 dip .1 header + [Gnd +Vbat]
        RTC MCP7941X or DS13x7 soic8 -- with backup battery header and side mount for a lithium CR23xx
        RAM 24Lxx ..24aa  soic8
        3 micro Push Buttons
        lots of Jumpers for options
            LCD Parrallel 2x8  Hitiachi type
            RS232 [in=a.3 +22kohm software, out=a.0 +1kohm]  + DB9f
            nRF24L01 2x4 pin - SPI RF radio
    
            1x1.5" Prototying area
    
            Other parts: lm7805, 10k trim pot [lcd contrast], 2.1mm-F power, lots of Jumpers for options
    
     
  • ofuzzy1

    ofuzzy1 - 2013-10-03

    Here's the 16f1829 memory read. [.hex]

    Yes, the code up top of memory looked unchanged 
    And the first three were as you posted:
    
    Code of 0x0000 ~ 0002 address is similar to the one below after writing.
    
    0000:301F movlw 0x1F
    0001:008A movwf PCLATH
    0002:2FA0 goto IntrareBootloader
    
    here's the first $20
    301F    008A    2FA0    3FFF    0009    2378    2340    238A
    233B    0024    160C    168C    3007    0021    009D    3007
    009E    0023    018C    018D    018E    0022    018C    018D
    018E    3007    0091    0192    3007    0093    0194    0023
    

    I did unplug the power, just using the PGM-ISP to power the board for now.
    in TBL changed delay to 2500 and tries to 100, still no luck.

     

    Last edit: ofuzzy1 2013-10-03
  • ofuzzy1

    ofuzzy1 - 2013-10-03

    Fixed it.

    I should of looked closed at word #4 3fff,
    had this in the code:
    ;#option bootloader 2

    ; is not a comment in GCB

     
  • edorul

    edorul - 2013-10-03

    Hello,

    Thanks for posting the solution!

    But, I'm not sure to understand. In order to get your program working did you add "#option bootloader 2" line or did you erase it?

    Best regards,
    Edorul

     
    • ofuzzy1

      ofuzzy1 - 2013-10-04

      I removed it.
      Then it worked.

      I assUmed the ; [semicolon]was a comment line.
      It's not, only ' [single_quote]

       

      Last edit: ofuzzy1 2013-10-04
      • edorul

        edorul - 2013-10-04

        Hello,

        Thanks for your answer!

        Best regards,
        Edorul

         

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.