I have a long assembler program with PIC16F1825 working ok. There are 6500 lines of code
Because availability problems I buyed some qty of PIC18f04Q41 because it was mentioned in MPLAB 5.35 as it be included in this version.
The problem is that after working with the many diferences I try to do some tests and found there is not included the assembler for this part in 5.35 and also not in any MPLABX version
How can I use Cow Basic for this case ?
I would apreciate any help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
6500 lines of code. What does it do ? Rewrite into GCBASIC then you have portable code to any microcontroller. 6.5k lines of ASM would be relatively easy to port.
The latest version of MPASM is 5.87 not 5.35. Download the latest version from the FILES tab of this forum. Then, change add Q41 to MPASM and then use MPASM.
Install 5.87
Manually edit the 8bit_device.info to replace an existing microcontroller entry with the Q41
Download the INC from the GBCASIC for the Q41 from GitHub
Compile.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your reply
I found your reply just today - perhaps I didn´t check "Subscribe to this topic "
We are a two old people team makeing small qtys of parts for trains models (www.LDHtrenes.com.ar)
The mentioned 6.5K program is for a DCC sound decoder (NMRA rules)
It is doing a lot of jobs, with 32MHz clock
Detect DCC protocol for ligths and motor control
Sintetizing sounds for Diesel motors or vapor locomotives
bell trump whistle compresor
With the pic18part , with hardware multiplication and 64MHz clock, I can improve some of the sounds.
A couple of years ago I moved the asm program to pic18f26q10 for more pins count to handing a flash memory with recorded sounds, plus the sintetized sounds
I had no notice of Cow Basic at this moment.
Now moving again the .asm to ...q41 is also hard but the MPLABX5.35 that includes ASSEMBLER 5.87 had not the ...q41.inc , but worst, it lacks other file ( I don´t remember the name at the moment ...dfp ?) needed for compiling
Please let me know if it may be more easy to learn Cow Basic and re-write the program or
to fix the MPlabX 5.87 for the pic18f04q41 ( if posible) and
MOVE A LOT of Conmmon Registers and SFR to different pages
This part is very different to original pic16f1825 and also to pic18f26q10 used before
Best Regards, Osvaldo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The concept of GCBASIC is to remove the complexity. Registers, SFR page management is all resolved. I truly believe that you can do more faster in GCBASIC rather than ASM.
If I may had this GCBASIC information about 3 years ago , most probabely I will choosed to re-write the program before moving to pic18F26Q10
At the moment the only problem is we have in stock 200 parts of pic18F04Q41
buyed near 20 months ago at price about u$ 1.00 . At this moment current used part pic16f1825 had no delivery for1 year.
But we will get in short 200 parts of the usually used PIC16F1825
They are 14 pins SMD totally compatible for the PCB.
At the moment I am very busy finishing a proyect: changing RS485 cable conexion between hand-held controller and the Command Station , to a RF link using low cost NRF24L01 based board, so any matter with the PIC18F04Q41 will be delayed.
I used assembler from the begining and not any C librarys
I got a lot of support from NRF manufacturer forum
I will begin with GCBASIC learning later
I think there is no a "magic" solution as de -compiling program memory list or .hex for used procesor PIC16F1825 to a source GCBASIC , and later compiling it for PIC18F04Q41 part
About yor interest about DCC there are available information in Paco Cañada site and also in other places MERG , JMRI about train control from a PC
There is an old SHOWDCC program only for WindowsXP that I have a copy . Simple hardware needed.
Best Regards, Osvaldo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a long assembler program with PIC16F1825 working ok. There are 6500 lines of code
Because availability problems I buyed some qty of PIC18f04Q41 because it was mentioned in MPLAB 5.35 as it be included in this version.
The problem is that after working with the many diferences I try to do some tests and found there is not included the assembler for this part in 5.35 and also not in any MPLABX version
How can I use Cow Basic for this case ?
I would apreciate any help
GCBASIC can resolve. Many methods.
Thank you for your reply
I found your reply just today - perhaps I didn´t check "Subscribe to this topic "
We are a two old people team makeing small qtys of parts for trains models (www.LDHtrenes.com.ar)
The mentioned 6.5K program is for a DCC sound decoder (NMRA rules)
It is doing a lot of jobs, with 32MHz clock
Detect DCC protocol for ligths and motor control
Sintetizing sounds for Diesel motors or vapor locomotives
bell trump whistle compresor
With the pic18part , with hardware multiplication and 64MHz clock, I can improve some of the sounds.
A couple of years ago I moved the asm program to pic18f26q10 for more pins count to handing a flash memory with recorded sounds, plus the sintetized sounds
I had no notice of Cow Basic at this moment.
Now moving again the .asm to ...q41 is also hard but the MPLABX5.35 that includes ASSEMBLER 5.87 had not the ...q41.inc , but worst, it lacks other file ( I don´t remember the name at the moment ...dfp ?) needed for compiling
Please let me know if it may be more easy to learn Cow Basic and re-write the program or
to fix the MPlabX 5.87 for the pic18f04q41 ( if posible) and
MOVE A LOT of Conmmon Registers and SFR to different pages
This part is very different to original pic16f1825 and also to pic18f26q10 used before
Best Regards, Osvaldo
Personally, I would rewrite. There is no support for my idea. I did a search and no one is doing this.
I have interest in the DCC protocol - so, get started. :-)
Are you sure about the Q41 ? There are better chips and cheaper. https://www.amazon.co.uk/OSOYOO-LGT8F328P-Compatible-ATmega328p-Interface/dp/B0BDM3FHF2 And, the LGT support much higher currents.
The concept of GCBASIC is to remove the complexity. Registers, SFR page management is all resolved. I truly believe that you can do more faster in GCBASIC rather than ASM.
Have a look at this source. https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/Vendor_Boards/Microchip_PICDEM_2_plus_board/20_Capability_demo.gcb This is shown how to use a lot of capabilities.
Now consider the ASM, with no comments ( I removed them as this give 12.5k lines of code ). The 9k lines of ASM code is created directly from the GCBASIC source. And, GCBASIC assembles also. See https://github.com/GreatCowBASIC/Demonstration_Sources/blob/main/Vendor_Boards/Microchip_PICDEM_2_plus_board/20_Capability_demo.asm
Regarding the Maths. GCBASIC will use the maths capability, if present in the chip, or it will use the robust routines.
Totally your call. But, you can use MPLAB-X. :-)
Last edit: Anobium 2024-09-03
If I may had this GCBASIC information about 3 years ago , most probabely I will choosed to re-write the program before moving to pic18F26Q10
At the moment the only problem is we have in stock 200 parts of pic18F04Q41
buyed near 20 months ago at price about u$ 1.00 . At this moment current used part pic16f1825 had no delivery for1 year.
But we will get in short 200 parts of the usually used PIC16F1825
They are 14 pins SMD totally compatible for the PCB.
At the moment I am very busy finishing a proyect: changing RS485 cable conexion between hand-held controller and the Command Station , to a RF link using low cost NRF24L01 based board, so any matter with the PIC18F04Q41 will be delayed.
I used assembler from the begining and not any C librarys
I got a lot of support from NRF manufacturer forum
I will begin with GCBASIC learning later
I think there is no a "magic" solution as de -compiling program memory list or .hex for used procesor PIC16F1825 to a source GCBASIC , and later compiling it for PIC18F04Q41 part
About yor interest about DCC there are available information in Paco Cañada site and also in other places MERG , JMRI about train control from a PC
There is an old SHOWDCC program only for WindowsXP that I have a copy . Simple hardware needed.
Best Regards, Osvaldo
Good to hear the plan.
At least the GCBASIC will be portable across 1825 to Q41 - sometimes with very little code changes.
Cheers.