Jump to content
Sign in to follow this  
MrNobody

Inserting Asm Lines In Boostc

Recommended Posts

Really sorry for the wrong title mods and people.. Initially, when I typed this post, I thought that the programming was written in ASM.. but then I realised that the code was actually written in Pic Basic (I think).. I am new to the world of PIC programming....

 

-Original Message-

Hi,

Below is a code to calculate the number of pulses and convert it into RPM to display in LCD.. If I am not mistaken, it is written in Pic Basic rite..? Can somebody please teach me how to convert it to C language (BoostC)..?

Thanks..

 

Device = 16F877

Xtal = 20

 

Dim Result as DWord

LCD_DTPIN = PORTB.4 ' Setup the LCD
LCD_RSPIN = PORTB.2 '
LCD_ENPIN = PORTB.3 '
LCD_INTERFACE = 4 '
LCD_LINES = 2 '
LCD_TYPE = 0 '

All_Digital = True ' Make all pins Digital I/O's

While 1 = 1

Result = COUNTER PORTA.0, 100 ' Count how many pulses in 100mS

Result = Result * 10 * 60 ' Scale To RPM

Print at 1, 1, "RPM = ", DEC8 Result ' Display on the LCD

Wend ' Loop for ever

Edited by MrNobody

Share this post


Link to post
Share on other sites

There are to tools that convert basic into C (as far as I know). The best way is to understand how code works and than just code same functionality in C.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×