Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Moving from mikroBasic to OshonSoft Basic

bcz

New Member
I have built a project back in 2010 with the PIC18F2550 using mikroBasic.
A few weeks ago I damaged the PIC by connecting +13.8VDC to pin RA5.
Trying to program a new PIC with the original hex file using the same programmer fails.
I am using the programmer "brenner8p5" and the software "USBurn V1.13 a3" both by "sprut".
The programmer reports that there is no config in the source file and to use manual Config-settings.
To make it short, I can't fix the project.
I wonder if with your advice/help I could modify the code from mikroBasic's "pbas" to OshonSoft's "bas"?
I am not sure which CONFIG settings I should make if I had to start from scratch with OshonSoft Basic.
Please find some documents attached.
Kind regards,
Robert
 

Attachments

  • LCM_Contrast.sch.jpg
    LCM_Contrast.sch.jpg
    187.6 KB · Views: 14
  • AD8307_Display.zip
    88.7 KB · Views: 12
The code should be modifiable. Your "float" should be declared as "single" for floating point numbers. Also ASM instructions have to be declared on every line, ie:
ASM: MOVLW $7F
ASM: ANDWF INTCON2, 1
and so on...

LCD devices have to be defined in detail, like number of bits, port, which bit is what function, etc. LCDout is a single line output, you have to use other LCD commands to position the cursor.

As for config, your file shows the following:
Count=4
Value0=_FOSC_HS_1H = $00FC
Value1=_WDT_OFF_2H = $00FE
Value2=_LVP_OFF_4L = $00FB
Value3=_XINST_OFF_4L = $00BF
so that seems to be the only configuration bits changed from "default"

The Oshonsoft compile will include the config code into the Basic Source if you select it from the configuration window/panel to "Generate Basic Code"
 
Here is an example of how to start up the 1602A display that uses the HL-K18 card.
Caution the example has the MCLR pin activated.
 

Attachments

  • LCD1602A 46K22.bas
    4.6 KB · Views: 4
Last edited:
The code is quite compatible.
One restriction is that Functions and Sub have to come after END, that is, at the end of the program and after the general termination of the main function END. END in this language does not mean end of program, it means end of the main routine.
 
DogFlu66 and sagor1,
Thank you both for the very usefull comments and advice that will help me creating the new code.
Robert
 

New Articles From Microcontroller Tips

Back
Top