i am trying to play around with the tiny bootloader and my pic12f1840, so far im not having luck getting my code to run and errors when using the bootloader software to flash my chip.
ill have to admit im confused as heck with this going around to all different posts i can find and info that is on the tiny bl page.
the info on the page states for tested compilers that gcb needs no code mods for the users file as it should run with no issues, the manual says that the command #option bootloader adress should be used to prevent code overwriting the bootloader, and in general im confused as a whole now.
i flashed the 12f1840 bootloader hex onto the chip with the pickit 3 and use my usb-ftdi to load my project hex after,no matter what i always get the same error message:
Check Device...
Open COM4 serial port at 19200bd
Hardware DTS reseting Device
Found: 12F 1840
Open HEX file: C:\gcb projects\winch V3 allworking.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 successfully repaired.
Transferring flash...
Transferring program memory...
Transferring HEX successfull :-)
Close COM4 serial port
regardless my code does not run so their must be something missing, and im not sure if i have to redirect its start adress or not, the only thing i could gather after trawling was that i need
option bootloader 0xXX.
i assume that would be 0x0005 as thats where the main program would start in the chips memory map according to the datasheet, trying to find more information that doesnt seem overly confusing has so far been hit and miss
the info on the page also mentions making sure the code can be compiled as absolute in mplab or other compiler but mplab just throwws so many errors out for any of the included files of the bootloader firmware for the 12f1840.
overall im confused now, can anybody shed some more light on this that doesnt involve the user(me) needing to feel like i need a degree in rocket science to half understand lol.
tony
Last edit: tony golding 2015-03-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just tried Tiny Multi Bootloader v10.0 with simple blink led on a 12f1822, same exact message window by the way, and everything is O.K. Don't use option bootloader!
Have you fully debugged your code with GCB? Program compiled at 16MHz? You may have to post code to see if that is the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
my main program is running at 8mhz so ill change that then, as for debugging in gcb? i just write,test on breadboard , read and follow through then write and test some more, thats debugging for me unless their is something that allows me to run it in simulation but regardless the code when run on the chip without bootloader runs flawlessly just when i use the v10 for this chip it seems to not work.
so the option bootloader command is not needed then? ill give that a try along with the different osc setting.
tony
Last edit: tony golding 2015-03-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i did initially earlier open the asm in mplab but again it would just throw me errors everywhere for any of the includes in the asm as supplied and stated it couldnt find this or that so would not be able to compile it back to a hex, its been a very busy but not so productive day so far lol
tony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well it still does not seem to want to run the code with the bootloader, flashed on the plain chip is fine but flashing the bootloader and then trying to get anything out of it after loading my hex via serial draws a blank.
im using every pin on this chip for something including RA3/MCLR which is a general purpose input with pullup enabled.
to start the code doing its thing the button on RA3 has to be pushed before anything else can even occur, sort of an arming feature so to speak so im not sure if that may have anything to do with this not playing ball.
tony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a conflict with the bootloader asm config? it is initialized with MCLRE=ON. Is the bootloader app Write Config Bytes box checked/unchecked? Typically the code is run unless the MCLR pin is pressed before a timeout appears on the bootloader (1 sec or?). Perhaps this works with MCLRE=ON?
Just as a note, I am using a CP2104 USB to ttl device, and have RTS pin going to MCLR pin on PIC.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i have tried it with the config settings box checked and unchecked,when i open the asm file for tiny in mplabx it shows MCLRE = ON but i cant change this because it wont let me recompile to hex.
instead it tells me that a few of the include files that are in the code cant be found so just fails to build, so i cant even attempt to change anything in their to see if that helps as it wont let me do anything after.
im using my arduino ftdi adapter, no RTS, only CTS and DTR, the tiny loader lets me select DTR seeing as its the only one on my adapter i stuck it on that one, it does appear to flash everytime i load it but thats it as far as success goes for this right now lol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well until you get a bare bones blinky led hex file loaded and working...
1) Reload stock bootloader hex (may have been corrupted?).
2) Compile blinky led @ 16 MHz hex file.
3) Load bootloader app, check Write Flash Program box only.
4) Do not use MCLR pullup, and let DTR do its thing.
You should have a working program. If not, then something else is wrong with procedure or hookup.
If you positively need to change the bootloader asm config, then maybe someone could help you out with MPLAB. It's been ages since I've used MPLAB.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i found some info on the tiny bootloader sourceforge page for the asm/mplab issue so i have somewhere to start with that at least but for now i will go back to beginners basics lol,.
well at least i have a nice little list to work through now and see what happens, thanks for the help kent.
tony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ok so i at least have tidied up the breadboard and wires, reflashed bootloader then loaded a simple led program and its working.
so the issue is im sure because of how i originally used RA3 as input with weak pullup, but that can be changed so just need to see if i can change the setting in the asm to use RA3 as an input instead of default MCLR.
tony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
after some thinking and reading i have summized that i cannot run this code on the chip as i need all the pins.
according to the ASM file config settings for the bootloader the LVP is enabled and after re reading the datasheet that means the MCLR is enabled and used for the bootloader.
so its not a big problem that i cant use it for this code, it was more a learn and try new things exercise but now its worked and i can at least look back to it later when i use a bigger pin count chip for something different.
tony
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i am trying to play around with the tiny bootloader and my pic12f1840, so far im not having luck getting my code to run and errors when using the bootloader software to flash my chip.
ill have to admit im confused as heck with this going around to all different posts i can find and info that is on the tiny bl page.
the info on the page states for tested compilers that gcb needs no code mods for the users file as it should run with no issues, the manual says that the command #option bootloader adress should be used to prevent code overwriting the bootloader, and in general im confused as a whole now.
i flashed the 12f1840 bootloader hex onto the chip with the pickit 3 and use my usb-ftdi to load my project hex after,no matter what i always get the same error message:
Check Device...
Open COM4 serial port at 19200bd
Hardware DTS reseting Device
Found: 12F 1840
Open HEX file: C:\gcb projects\winch V3 allworking.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 successfully repaired.
Transferring flash...
Transferring program memory...
Transferring HEX successfull :-)
Close COM4 serial port
regardless my code does not run so their must be something missing, and im not sure if i have to redirect its start adress or not, the only thing i could gather after trawling was that i need
option bootloader 0xXX.
i assume that would be 0x0005 as thats where the main program would start in the chips memory map according to the datasheet, trying to find more information that doesnt seem overly confusing has so far been hit and miss
the info on the page also mentions making sure the code can be compiled as absolute in mplab or other compiler but mplab just throwws so many errors out for any of the included files of the bootloader firmware for the 12f1840.
overall im confused now, can anybody shed some more light on this that doesnt involve the user(me) needing to feel like i need a degree in rocket science to half understand lol.
tony
Last edit: tony golding 2015-03-30
Just tried Tiny Multi Bootloader v10.0 with simple blink led on a 12f1822, same exact message window by the way, and everything is O.K. Don't use option bootloader!
Have you fully debugged your code with GCB? Program compiled at 16MHz? You may have to post code to see if that is the problem.
thanks kent,
my main program is running at 8mhz so ill change that then, as for debugging in gcb? i just write,test on breadboard , read and follow through then write and test some more, thats debugging for me unless their is something that allows me to run it in simulation but regardless the code when run on the chip without bootloader runs flawlessly just when i use the v10 for this chip it seems to not work.
so the option bootloader command is not needed then? ill give that a try along with the different osc setting.
tony
Last edit: tony golding 2015-03-30
O.K. I just meant that the program is fully working (debugged), you have that.
You can change the OSC, baud rate, config etc. in the Tiny device asm file. But, then you would need to create a MPLAB project for the new hex file.
i did initially earlier open the asm in mplab but again it would just throw me errors everywhere for any of the includes in the asm as supplied and stated it couldnt find this or that so would not be able to compile it back to a hex, its been a very busy but not so productive day so far lol
tony
well it still does not seem to want to run the code with the bootloader, flashed on the plain chip is fine but flashing the bootloader and then trying to get anything out of it after loading my hex via serial draws a blank.
im using every pin on this chip for something including RA3/MCLR which is a general purpose input with pullup enabled.
to start the code doing its thing the button on RA3 has to be pushed before anything else can even occur, sort of an arming feature so to speak so im not sure if that may have anything to do with this not playing ball.
tony
Is there a conflict with the bootloader asm config? it is initialized with MCLRE=ON. Is the bootloader app Write Config Bytes box checked/unchecked? Typically the code is run unless the MCLR pin is pressed before a timeout appears on the bootloader (1 sec or?). Perhaps this works with MCLRE=ON?
Just as a note, I am using a CP2104 USB to ttl device, and have RTS pin going to MCLR pin on PIC.
i have tried it with the config settings box checked and unchecked,when i open the asm file for tiny in mplabx it shows MCLRE = ON but i cant change this because it wont let me recompile to hex.
instead it tells me that a few of the include files that are in the code cant be found so just fails to build, so i cant even attempt to change anything in their to see if that helps as it wont let me do anything after.
im using my arduino ftdi adapter, no RTS, only CTS and DTR, the tiny loader lets me select DTR seeing as its the only one on my adapter i stuck it on that one, it does appear to flash everytime i load it but thats it as far as success goes for this right now lol
Well until you get a bare bones blinky led hex file loaded and working...
1) Reload stock bootloader hex (may have been corrupted?).
2) Compile blinky led @ 16 MHz hex file.
3) Load bootloader app, check Write Flash Program box only.
4) Do not use MCLR pullup, and let DTR do its thing.
You should have a working program. If not, then something else is wrong with procedure or hookup.
If you positively need to change the bootloader asm config, then maybe someone could help you out with MPLAB. It's been ages since I've used MPLAB.
i found some info on the tiny bootloader sourceforge page for the asm/mplab issue so i have somewhere to start with that at least but for now i will go back to beginners basics lol,.
well at least i have a nice little list to work through now and see what happens, thanks for the help kent.
tony
ok so i at least have tidied up the breadboard and wires, reflashed bootloader then loaded a simple led program and its working.
so the issue is im sure because of how i originally used RA3 as input with weak pullup, but that can be changed so just need to see if i can change the setting in the asm to use RA3 as an input instead of default MCLR.
tony
ok this one is solved i hope,
after some thinking and reading i have summized that i cannot run this code on the chip as i need all the pins.
according to the ASM file config settings for the bootloader the LVP is enabled and after re reading the datasheet that means the MCLR is enabled and used for the bootloader.
so its not a big problem that i cant use it for this code, it was more a learn and try new things exercise but now its worked and i can at least look back to it later when i use a bigger pin count chip for something different.
tony