Jump to content


Photo

Novo & Boostbasic

Novo Basic

8 replies to this topic

#1 hjlink

hjlink

    Newbrie

  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 30 October 2012 - 03:58 PM

I am working on a simple program just to blink an LED. This is my way of teaching myself how to use the Novo RTOS with BoostBasic. I am using MPLAB for the IDE with Notepad++ as an external editor. When I compile I get the following error:

Executing: "C:\Program Files\SourceBoost\boostbasic_pic16.exe" MPLABIDETest.bas -O1 -W1 -t 16F877A
BoostBasic Optimizing Basic Compiler Version 7.10 (for PIC16 architecture)
http://www.sourceboost.com
Copyright© 2004-2012 Pavel Baranov
Copyright© 2004-2012 David Hobday

Licensed to Henry Link under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited


MPLABIDETest.bas
MPLABIDETest.bas(20): error: general error
MPLABIDETest.bas(20): error: failure

failure
BUILD FAILED: Tue Oct 30 11:44:15 2012

If I comment out line 21 (call SysTimerUpdate) the the error above moves to line 27 (the next call to Novo). Any ideas? I get the impression there is very little if any use of Boostbasic with Novo. I've included the source below.

Source code:

#include <basic/system.bas>
#include <basic/novocfg_pic16t6e4ts2_h.bas>
#include <basic/novo_h.bas>


#pragma DATA _CONFIG, _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_OFF & _XT_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF
#pragma CLOCK_FREQ 4000000
#pragma OPTIMIZE "1"

dim mscounter as dword 'used to count ms ticks of TIMER0
dim seccounter as byte 'used to count seconds from mscounter


sub interupt ()
tmr0 = 6
mscounter = mscounter + 1
if mscounter = 10000 then
seccounter = seccounter + 1
mscounter = 0
end if
call SysTimerUpdate ()
end sub

sub TaskToggleLED(byref PC as byte)
PC = PC ^ 00000001b
portc = PC 'Flip the 1st LED
call Sys_Sleep(500)
end sub


sub main()
dim ShadowC as byte = 0
'setup PIC
trisc = 0 'Set port c to all output
option_reg = 0x84
intcon = 0xA0
call SysInit()
call SysCreateTask(0, 7, TaskToggleLED)

'main loop
do while 1
call Sys_Yield()
loop

end sub

#2 JorgeF

JorgeF

    Super Enthusiast

  • EstablishedMember
  • PipPipPip
  • 274 posts
  • Gender:Male
  • Location:ES @ Europe, third rock from the Sun

Posted 31 October 2012 - 09:33 AM

Hi

Don't know if you have already took care of that but...
When using MPLAB you have to explicitly include de novo library in the project.

Unlike the Sourceboost IDE that knows they are needed and were to find them, MPLAB needs to explicitly be told that "novolib_xxxxx" is part of the project.


BTW: Don't forget the "swcs" switch for the linker.

Best regards
Jorge

Edited by JorgeF, 31 October 2012 - 09:33 AM.


#3 hjlink

hjlink

    Newbrie

  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 31 October 2012 - 01:40 PM

I cut and past the exact same code into SourceBoost IDE and received the exact same error. So I am very frustrated with their whole product right now. Do I need to include some type of C header file or objects to make this work?

#4 Pavel

Pavel

    Super Maniac

  • Administrators
  • PipPipPipPipPip
  • 1,446 posts
  • Gender:Male
  • Location:Melbourne, Australia

Posted 01 November 2012 - 09:21 AM

There are a few problems with your code:

- don't use the 'call' keyword with Novo calls
- incorrect way to create Novo task (check examples from SourceBoost installation for the correct usage)
- incorrect task function signature (check examples from SourceBoost installation for the correct usage)

The best way to start is to use examples from SourceBoost installation as starting point.

Regards,
Pavel

#5 hjlink

hjlink

    Newbrie

  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 01 November 2012 - 01:34 PM

Well that is a problem... THERE ARE NO EXAMPLES in BoostBasic. Everything is in C. In addition your Novo manual stats that a call command should be used for BoostBasic. I am good about figuring things out on my own as long as I have good information or examples. And I did sort of figure my other calls to Novo for create task etc. might be wrong. But I couldn't even get to that line of could to see what error the compiler would produce. I will give this a try. But at this point I think it might be better to give up on BoostBasic and switch to BoostC.

#6 hjlink

hjlink

    Newbrie

  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 01 November 2012 - 02:59 PM

OK, removing 'call' worked. So the last part I need is the proper way to create tasks. The only thing I'm not clear on is how to create a handle that can be passed to SysCreateTask. Do you have an example of this? I tried to use #define like the C examples show and that doesn't work.

#7 Pavel

Pavel

    Super Maniac

  • Administrators
  • PipPipPipPipPip
  • 1,446 posts
  • Gender:Male
  • Location:Melbourne, Australia

Posted 01 November 2012 - 11:12 PM

Well that is a problem... THERE ARE NO EXAMPLES in BoostBasic...


Of course there are. Look into <Your SourceBoost Samples folder>\Basic\novo. There are 5 sample Novo projects in Basic there.

Regards,
Pavel

#8 hjlink

hjlink

    Newbrie

  • EstablishedMember
  • 6 posts
  • Gender:Male

Posted 02 November 2012 - 01:34 PM

I found the examples. However, why aren't any of these examples (or the location of these examples) not in the PDF documentation? There should be at lease one example of the BoostBasic & Novo in the Novo PDF document. I search the program installation folder and the PDF for examples. I didn't know they were put in "My Documents" folder. If I had known about these examples to begin with it would have made a big difference.

#9 Pavel

Pavel

    Super Maniac

  • Administrators
  • PipPipPipPipPip
  • 1,446 posts
  • Gender:Male
  • Location:Melbourne, Australia

Posted 03 November 2012 - 09:33 AM

I found the examples. However, why aren't any of these examples (or the location of these examples) not in the PDF documentation? There should be at lease one example of the BoostBasic & Novo in the Novo PDF document.


Yes there should be. We'll add this into our todo list.

I search the program installation folder and the PDF for examples. I didn't know they were put in "My Documents" folder. If I had known about these examples to begin with it would have made a big difference.


Location for the examples is specified during SourceBoost installation and you can change it to any place on your computer. Maybe you just missed this.

Regards,
Pavel



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users