Jump to content

SX delay_xx routines


Recommended Posts

I'm developing on a SX48 that I have running at 50 MHz, and have had the CLOCK_FREG pragma set to 50000000.  When I used SourceBoost's delay_s and delay_ms routines, they never seemed to return.


When I change CLOCK_FREQ to 50000, and time them (using LED flashes), they seem to operate perfectly.


This makes me think that, originally, they were just taking 1000 times longer than I expected, and so I would give up before the delay returned.


The manual says that the pragma should be in Hz, which should make the original configuration correct.  Am I missing something?



Side note:

I have to set TURBO_MODE to 0 to get removely close, but I fully expect this since the SX48 does not support "compatible/turbo" mode.  So I am not considering this pragma to have anything to do with the problem.

Link to comment
Share on other sites

swooshxx, the problem is due to no include file.

Look at the menu settings then click options.  In the include box there is nothing.  Now set your target as a sx28ac.

Also view your asm there is no settings defined.  This is due to the fact that there is no Psx48bd.inc or 52 file put in the include file.  Look at the other psx18.inc and Psx28.inc or Psx28ac.inc file for more.

Me I even changed this since Pavel might be more into the pic side of it.  I changed Psx28ac.inc to the following





   FREQ 50000000


From what he had set up.


   ID 'C2C test'


I would suggest making a new file called PSX48BD.INC under the sourceboost/include directory.


Copy the following into it.





   FREQ 50000000


Once this is done goto the menu settings then click options.

When the toolbox comes up then copy the following to the include textbox.  This is assuming that sourceboost is in the same local as mine.



Recompile and check your asm file your defines should be there now.


On a side note the aformentioned routines have always worked for me.

Link to comment
Share on other sites

Sorry guys, my bad  :(


After a couple of hours of messing with this, it ended up being the external oscillator configuration.  Somehow, this got set to "RC Network" instead of "High Speed Crystal".


I still don't know how this kicked down the speed by exactly 1000 times (why I didn't check this earlier), but it doesn't matter anymore.


Hate to be one of those guys that "blamed the tools" when his stuff didn't work!  My apologies to the SourceBoost team, and my congrats on a great product!

Link to comment
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.


  • Create New...