Jump to content
futz

Boostc Inline Assembly With Mplab X V3.55

Recommended Posts

Anybody have a working example of how to do inline assembly with BoostC and MPLAB X v3.55? I've tried everything in the manual, but nothing works. It just errors out with "unknown assembly identifier"s.

 

It's happy with my nop's, but complains about porta and PORTA.

 

Tried a bunch of other things - no go. Here's the last thing I tried - no go:

asm("bsf porta,0");
asm("nop");
asm("nop");
asm("bcf PORTA,0");
asm("nop");
asm("nop");
asm("nop");

 

 

Share this post


Link to post
Share on other sites

Hi Futz,

 

Have you tried _porta (that is underscore porta).

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Have you tried _porta (that is underscore porta).

Yes. :D After posting my question here I continued Googling. Found it about a half hour later on someone's blog. Thanks for the help though.

 

Code looks like this now, and it works. I'm tinkering with WS2812s. Still need to put a few more things into the asm section to tighten up timing more, but it's good for now.

asm{

bsf _porta,0

nop

nop

nop

bcf _porta,0

}

}

else{

asm{

bsf _porta,0

nop

bcf _porta,0

}

}

byte <<= 1;

 

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 emoticons maximum 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...

×