MEL PICBASIC Forum - MELabs PICBASIC

• ### Recent Forum Posts

#### 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 Today, 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 Today, 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 Today, 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 Today, 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 Today, 15:01

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

Thanks! this is way better and simpler. Speaking speed-wise, will this be faster in execution than my code with additional variable?

CuriousOne Today, 14:42

#### Re: Newbie Manchester Coding question

Duh, yup, that was it [slapping forehead].

Cheers,

Troy

rocket_troy Today, 14:22

#### Re: Newbie Manchester Coding question

the DEBUG output is inverted logic to suit the pickit 2 serial input, your setup might req true logic
try
DEFINE DEBUG_MODE 0 ' Debug mode: 0 = True, 1 = Inverted

me too , i was...

richard Today, 13:03

#### Re: Newbie Manchester Coding question

Back... [and total exhausted]

Thanks sooo sooo much Richard and Dave (particularly Richard). I just ran Richard's code and as expected I got complete and utter nonsense - I have no luck in...

rocket_troy Today, 12:25

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

I think what you're looking for is the modulo operator (//).
It will return the remainder of a division so whenever it returns 0 it means it was an "even division".

MainCount = MainCount + 1...

HenrikOlsson Today, 12:17
• # 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.
...