Software UART version running on 18F25K22 [solved] - Printable Version +- ds30 Loader free edition forums (https://picbootloader.com/forum) +-- Forum: Support (https://picbootloader.com/forum/forumdisplay.php?fid=3) +--- Forum: 8-bit firmwares (https://picbootloader.com/forum/forumdisplay.php?fid=7) +--- Thread: Software UART version running on 18F25K22 [solved] (/showthread.php?tid=184) |
Software UART version running on 18F25K22 [solved] - matherp - 2011-06-09 Hi all I have successfully built versions of the bootloader for both the 18F25K22 and 18F14K22 which are the chips used for the Picaxe 28X2 and 20X2. These have been set up with 64Mhz internal clock and inverted comms to use the standard 22k resistor picaxe download circuit but of course the bootloader uses the hardware UART whereas the picaxe uses different pins (in the case of the 28X2 it uses RA4 for RX and RA5 for TX). It would be nice to use the bootloader in the standard picaxe development boards so I have coded a software uart at 38400 baud which uses the correct picaxe pins. This is working to the extent that I get the following messages in the DS30 GUI: Found PIC18F25K22fw ver. 3.0.0 Waiting for bootloader to be ready...ok It then says: Writing flash...bl protection tripped Write failed Tx 236 bytes/Rx 10 bytes /4s The program I'm loading is a simple LED flash coded in Swordfish which works perfectly with the standard UART-based bootloader When using the standard bootloader the GUI reports 231 bytes but with the SW UART it says 229. However, it seems to pass the checksum test OK as if I patch out the checksum test I get the expected checksum error I had to increase BLPLP and BLSIZEP to 9 to fit the additional code into the bootloader (I've also tried 10) and have added 4 bytes at the bottom of the variable cblock. This is my first foray into PIC assembler (my last real use of assembler was on the DEC PDP11 and Motorola 6809!). I would appreciate any insights into where to look for the problem. I will of course be happy to share the output once this is all working best regards Peter RE: Software UART version running but BL protection issue found - matherp - 2011-06-09 I've now done more work and by removing the timeout in the SW receive got the program into 8 pages the same as the hardware version and the BL protection issue has gone away. The loaded program is now identical in memory in both cases. However in the hardware version it starts and runs but in the software version it doesn't which is because it is the timeout that trips the bootloader into the entry to the loaded program. Next step was to set BLPLP and BLSIZE back to 8 but not define PROT_BL which saves space and eliminates the error. This works and the program now runs So the issue is that the blprot routine doesn't seem to work when BLSIZE is 9. I think this is one for Mikael: best regards Peter RE: Software UART version running but BL protection issue found - Mikael Gustavsson - 2011-06-09 Hi, It does work! Remove the protection and use size 9 and you will see that the boot loader will get partly overwritten. You need to configure the custom boot loader size in the GUI under the advanced tab. You need to active advanced mode first. Mikael Software UART version running on 18F25K22 - matherp - 2011-06-09 Mikael Many thanks - that solves that. For anyone who is interested code to run a 38400 baud software UART on a 64Mhz 18F25K22 (picaxe 28X2) using the standard picaxe download pins (RX = RA4, TX=RA5) is attached. It also works at 19200 baud on a 32Mhz part. Code: ;------------------------------------------------------------------------------ Code: #define BUFFERSIZE (ROWSIZEB + 1 ) ;row + checksum BLPLP and BLSIZEP need to be set to 9 in settings.inc and as per Mikael's note this need to be mirrored in the DS30 GUI and/or command line interface Best regards Peter RE: Software UART version running on 18F25K22 - Mikael Gustavsson - 2011-06-10 Great! Thanks for sharing your code. RE: Software UART version running on 18F25K22 [solved] - bogdanaioane - 2017-01-29 Hi Peter, I am very new to all this and am trying to get into programming. a few months ago i went to this market for second hand electronix and found a few tubes of new PIC18F14K22. since then i started playing arround with them so i had to buy a pickit3 and some other bits and bobs. then recently i discovered picaxe and i think it's great for beginners like me. and when i saw that the picaxe20x2 chip is actually a 18F14K22 i went crazy happy as i thought "hey i have a bunch of these... so.. great" ofcourse i didnt realize that they are not just plain 18f14k22 chips but rather they have a bootloader installed that make them work with picaxe. So off to the internet i went in search for a way to install this bootloader myself. not much luck... until i found your post about this subject and the spark of hope reignited. can i please ask you, if at all possible, to help me with the code you wrote for the picaxe20x2 bootloader? not sure if i can be of any help to you in return but maybe i can send you some PIC's in return? (as i said i have a few) thanks RE: Software UART version running on 18F25K22 [solved] - Mikael Gustavsson - 2017-01-29 Start a new thread. |