Jump to content
Sign in to follow this  
swooshxx

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.

Share this post


Link to post
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

 

   DEVICE SX28AC, BANKS8

   DEVICE TURBO, OSCHS1, BOROFF

   DEVICE STACKX, OPTIONX

   FREQ 50000000

 

From what he had set up.

DEVICE SX28L, TURBO, STACKX_OPTIONX

   ID 'C2C test'

 

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

 

Copy the following into it.

 

   DEVICE SX48BD

   DEVICE OSCHS1, BOROFF

   DEVICE STACKX, OPTIONX

   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.

C:\PROGRA~1\SOURCE~1\INCLUDE\PSX48BD.INC

 

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

 

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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites
Guest Pavel
Hate to be one of those guys that "blamed the tools" when his stuff didn't work!

Don't worry, we are in the same club  :(  Glad you found the cause of the problem.

 

Regards,

Pavel

Share this post


Link to post
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.

Guest
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  

×
×
  • Create New...