MEL PICBASIC Forum - MELabs PICBASIC

• ### Recent Forum Posts

#### Re: Help with Using the Catalex MP3 Player

Hi

Program is doing what I want for now.... putting the clear in before the goto has cleared a lot of the issues.

I know it is still not elegant and will have issues still... I am "not" a...

andybarrett1 Today, 09:13

#### Re: Doing something at predefined amount of steps?

for the sign, so long as a & b are the same variable type:

if (a - b) > a then
sign = 1 ' result will be negative
else
sign = 0 ' result will be positive or zero
endif

Art Today, 05:24

#### Re: Doing something at predefined amount of steps?

No, 200-300=65436.
65435 is -101 in two's complement because 65435+101 = 65536 which, when being truncated to 16 bits is 0.

If what you want is the difference between the two numbers while not...

HenrikOlsson Yesterday, 23:01

#### Re: Doing something at predefined amount of steps?

Thanks Henrik, so Say A=200 B=300, C in this case will be 65535-100=65435, right? So if I take 65535 and minus it result, I should receive correct difference between A and B, right?

CuriousOne Yesterday, 18:46

#### Re: Doing something at predefined amount of steps?

towlerg Yesterday, 18:13

#### Re: Doing something at predefined amount of steps?

It will wrap around, 0-1=65535 provided the variable where the result is stored is a WORD.

HenrikOlsson Yesterday, 17:23

#### Re: Doing something at predefined amount of steps?

Oh and by the way, currently I don't have access to machine with PBP, what will happen if C=A-B and B is > A ? all variables are word length. I need to determine difference between A and B, but...

CuriousOne Yesterday, 16:56

#### Re: Doing something at predefined amount of steps?

Yes, I meant exactly that one.

In my case, there will be 16F886 running at 8mhz and maximum frequency will be around 2khz, so I guess, modulo variant will also work. Will assemble test circuit...

CuriousOne Yesterday, 16:54

#### Re: Doing something at predefined amount of steps?

Wasn’t it just something like this?
not even timing of course because every fifth iteration takes slightly longer to execute, but could be balanced up if it mattered.

variable var word...

Art Yesterday, 15:30

#### Re: Doing something at predefined amount of steps?

I don't know for sure but since it involves division my guess is that this is slower. Speed isn't always everything though.

Tell you what, why don't you try both ways and measure the difference,...

HenrikOlsson Yesterday, 15:01
• # MELabs PICBASIC

PICBASIC PRO™ Compiler 3.0 PBP is a BASIC programming language for Microchip's PIC microcontrollers.

Version 3 is a major evolution of this popular product, making it even more capable, stable, and reliable. All the years of development culminate here, with many new capabilities and improvements. Come see why thousands of engineers, educators and hobbyists have depended on PBP for more than a decade.
• Supports more than 500 microcontrollers.
• Newly revised 300-page manual.
• MPLABX compatible

Software activation keys are delivered electronically after purchase.
15 Day Trial Before Activation Key is Required

If installed without an activation code, the software will be fully functional for 15 days.

PBP 3.0 Gold Edition
Price: £171.94
Supports more than 500 devices.
 PBP 3.0 Silver Edition Price: £76.40 Supports Mid-Range devices.
PBP 3.0 Experimenter Edition
Price: £31.82
Supports 16F886, 18F2550, 18F25K20, and 18F25K22.
PBP Manual and CD
Price: £19.07
Printed Reference Manual and Installation CD.

Number of computer installations allowed 3
(May be uninstalled and moved. License is for single user.)
Number of computer installations allowed 3
(May be uninstalled and moved. License is for single user.)
Number of computer installations allowed 1
(May be uninstalled and moved. License is for single user.)
Maximum supported clock frequency 64Mhz
Maximum supported clock frequency 20Mhz
Maximum supported clock frequency 64Mhz
Compatible with Amicus18 Development System Compatible with Amicus18 Development System A perfect companion to the Amicus18 Development System

### What is PBP?

PBP is a BASIC programming language for Microchip's PIC microcontrollers.

It has evolved over the span of 15 years, making it the industry standard in its field. It has become a professional-level development tool for embedded programmers, though it retains the easy-to-learn syntax that makes it popular among experimenters and educators worldwide.
...

### Compare Editions

PBP3 is available in THREE editions, Chose the right one for YOU!. From Experimenter - enough for the hobbyist through Silver & GOLD - strong enough for a Pro. Including commercial licenses and annual update packages.
...

### Technical Information

PBP is a mature BASIC compiler for Microchip's PIC microcontrollers. Its licensed user base of 10,000+ is composed mostly of engineers and companies. It is intended to be a professional development tool, though its painless syntax also makes it a favorite among hobbyists and institutions of learning.

PBP generates Assembly language that consists of hand-tuned macros and library routines. This laborious approach in development makes for extreme efficiency in handling operations with a variety of variable types. Each math and comparison operation is generated according to the specific variable types that are used as inputs and output. High-level commands are included as library routines that are reused to minimize code space consumption, and these routines are tuned based on the device's memory characteristics and selected oscillator frequency.
...

### Features

PICBASIC PRO™ Compiler 3.0
• Familiar BASIC syntax
• IF (condition) THEN / ELSE / ELSEIF /ENDIF
• SELECT CASE
• FOR… NEXT
• DO WHILE/UNTIL
...

### MicroCode Studio Plus 5.0

MicroCode Studio Plus 5.0 (compatible with PBP 3.0 or later)
The main editor provides full syntax highliMicroCode Studio Plus is a powerful, visual Integrated Development Environment (IDE) with In Circuit Debugging (ICD) capability designed specifically for PICBASIC PRO™ Compilerghting of your code with context sensitive keyword help and syntax hints. The code explorer allows you to automatically jump to include files, defines, constants, variables, aliases and modifiers, symbols and labels, that are contained within your source code. Full cut, copy, paste and undo is provided, together with search and replace features.
...

...

### Product Activation

When installed PBP3 will operate in trial mode for 15 days, we recommend that you TRY PBP3 BEFORE you buy PBP3. Be sure that you are happy with the product and the facilities it offers

After purchasing your PBP3 license, the product may be activated by entering the activation key as prompted by the application, this process should be carried out whilst your host machine has access to the internet. Activation requires that the machine can contact the melabs activation service.
...