Problem with Nop blocks

Create new topics, add your comment, remark, bugs...
Post Reply
laurent841
Posts: 4
Joined: Mon Apr 13, 2009 4:47 pm

Problem with Nop blocks

Post by laurent841 » Tue Apr 21, 2009 9:16 am

Hi,

I have some problems using Nop blocks. It seems that they aren't taken into account, even if I put values like 4000000 (1 second for my 4.00 MIPS configuration). It works fine when I use the Microchip C funtion Delay instead of Nop blocks, but I would like to use Nop blocks for very small delays.

Does anybody encountered the same problem ?

Thank you in advance,

Laurent

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Problem with Nop blocks

Post by LubinKerhuel » Tue Apr 21, 2009 7:54 pm

Hi Laurent,

The Nop Block must be placed between two others blocks, and connected on the ordering input/output of theses two blocks.

Post the simulink model if you have problems. Anyway, it is not adapted for 1s delay.

Lubin

laurent841
Posts: 4
Joined: Mon Apr 13, 2009 4:47 pm

Re: Problem with Nop blocks

Post by laurent841 » Fri Apr 24, 2009 2:42 pm

Hi Lubin,

In fact I use Nop blocks for SPI communication,in order to respect waiting delays that are imposed. For 4.00 MIPS, when I put a block of 40 Nop (10 µs) between two SPI readings, delays are not taken into account when running the model on my dsPIC33. On the other hand, it does work fine when I use a C function call block that calls the function Delay(int), provided by Mirochip.

I don't understand why Nop blocks are not taken into account by the dsPIC. I join you a part of the model in order to illustrate the use of a Nop block.

Thank you for your help,
Kind regards,

Laurent
Attachments
Nop-block.JPG

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Problem with Nop blocks

Post by LubinKerhuel » Wed May 06, 2009 11:04 pm

Hi Laurent,

That is strange as I use the nop function and it seems to work.
Could you post the .mdl file please ?
Did you loocked in the generated C file ?

Perhaps the compiler optimisation configuration removes nop instruction ?

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests