I wish to write a bootloader in GCBASIC. What I need is for the ORG assembly directive to be passed thru to the assembler. Right now it generates an error.
Is there anyway to use the assembler separately?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As far as I know, the assembly drops thru to the assembler, so that shouldn't be the problem. My guess is that the source file for the compiler is not letting you pass the org statement thru. So until further help arrives....
Tried the Sparkfun Bloader bootloader from the most recent thread on this issue. Got a heartbeat back from the bootloader, but could not download a hex file. Maybe a board issue, maybe not. In the end, its just easier to do ICSP from my perspective. If a bootloader was wrapped into an IDE, that might change my mind.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using org will also allow Screamer to work. What I would like is the compiler in a form before this bootloader code at 0x0000 was added and ORG allowed. Making these changes will expand the usefullness of the compiler and leave the user more in control.
Take a look at Oshonsoft.com which includes a basic compiler. On the same site under projects you will find a bootloader which will work across all the 16F series by simply recompiling, since the loader is written in basic with inline assembly code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One more comment. I compiled the BlinkLED.txt program and downloaded it to a 16F877A using the Oshonsoft bootloader. It worked perfectly except for the code inserted by the compiler. The problem is the Call INITSYS. I realize that I could take the BlinkLED.asm and edit it and use MPLAB assembler or the GCBASIC built in assembler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I also used the update.zip mentioned in the bootloader posts that moves the call INITSYS. If the above changes can be made to the compiler we will have another working bootloader.
I still would like the ORG pass thru so I can write the bootloader with GCBASIC.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good job with the bootloadeer. Threw your org statements in a testled.asm file, also for a 16f877A, and reassembled with MPLAB. Tried the Screamer again, and still getting an "incorrect response - 0 from the Pic, programming halted" message. Makes me think the 6ft Prolific usb to serial cable might be an issue, as the Screamer was supposed to work per the other bootloader thread anyways.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to try the oshonsoft.com bootloader you will need to purchase Pic_Sim_IDE for 29euro. This is a great deal since it will compiler 8K code space and has a simulator. The bootloader has complete source in basic though the PC part is done with VB and there is no source. You can recompile it to work with different 16F parts.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wish to write a bootloader in GCBASIC. What I need is for the ORG assembly directive to be passed thru to the assembler. Right now it generates an error.
Is there anyway to use the assembler separately?
As far as I know, the assembly drops thru to the assembler, so that shouldn't be the problem. My guess is that the source file for the compiler is not letting you pass the org statement thru. So until further help arrives....
Tried the Sparkfun Bloader bootloader from the most recent thread on this issue. Got a heartbeat back from the bootloader, but could not download a hex file. Maybe a board issue, maybe not. In the end, its just easier to do ICSP from my perspective. If a bootloader was wrapped into an IDE, that might change my mind.
ORG does not drop thru, I tried it. Normal assembly codes drops thru, but assembly directives do not.
I know that changes were made to the compiler for the Scream bootloader, but here is a more elegant solution:
asm: org 0x0000
asm: bcf pclath,3
asm: bcf pclath,4
goto start
asm: org 0x0004
asm: retfie
start:
Using org will also allow Screamer to work. What I would like is the compiler in a form before this bootloader code at 0x0000 was added and ORG allowed. Making these changes will expand the usefullness of the compiler and leave the user more in control.
Take a look at Oshonsoft.com which includes a basic compiler. On the same site under projects you will find a bootloader which will work across all the 16F series by simply recompiling, since the loader is written in basic with inline assembly code.
One more comment. I compiled the BlinkLED.txt program and downloaded it to a 16F877A using the Oshonsoft bootloader. It worked perfectly except for the code inserted by the compiler. The problem is the Call INITSYS. I realize that I could take the BlinkLED.asm and edit it and use MPLAB assembler or the GCBASIC built in assembler.
I now have the Oshonsoft bootloader working with GCBASIC. I compiled the BlinkLED.txt and then edited the compiled.asm file to:
ORG 0
bcf pclath,3
bcf pclath,4
goto SystemInitialise
;Interrupt vector
ORG 4
retfie
SystemInitialise
call INITSYS
I also used the update.zip mentioned in the bootloader posts that moves the call INITSYS. If the above changes can be made to the compiler we will have another working bootloader.
I still would like the ORG pass thru so I can write the bootloader with GCBASIC.
Good job with the bootloadeer. Threw your org statements in a testled.asm file, also for a 16f877A, and reassembled with MPLAB. Tried the Screamer again, and still getting an "incorrect response - 0 from the Pic, programming halted" message. Makes me think the 6ft Prolific usb to serial cable might be an issue, as the Screamer was supposed to work per the other bootloader thread anyways.
If you would like to try the oshonsoft.com bootloader you will need to purchase Pic_Sim_IDE for 29euro. This is a great deal since it will compiler 8K code space and has a simulator. The bootloader has complete source in basic though the PC part is done with VB and there is no source. You can recompile it to work with different 16F parts.
Sorry for taking so long to reply, busy week!
The asm directive now works properly, and can be used to pass ORG through to assembly. For example, to insert ORG 0x240 use this command:
asm ORG 0x240
I've also added a new #option parameter: bootloader. If #option bootloader is not specified, the first 4 program memory locations will contain this:
call INITSYS
goto SystemInitialise
-
-
If #option bootloader is specified, the first 4 words will be as follows:
clrf PCLATH
goto SystemInitialise
-
-
InitSys is then called later on in the program, after the SystemInitialise label.
These changes are in http://gcbasic.sourceforge.net/newfiles/update.zip
Hugh, please do me one more favor and under #option bootloader add
org 4
retfie
The bootloader jumps to address 5 and I need to patch the "retfie" and reassemnble each time.
Thanks