CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Suspect SPI bug in 4.103

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Langton



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

Suspect SPI bug in 4.103
PostPosted: Thu Dec 10, 2009 8:49 pm     Reply with quote

So I've upgraded my compiler to overcome a SPI bug just to run straight into what appears to be another SPI bug...I am not a happy camper Crying or Very sad

This time I do this...
#use spi (FORCE_HW,SPI1,MASTER,BITS=8,BAUD=250000)

and my SPI1CON1 register bit stays on 16bit rather than going to 8bit mode.

Processor is a dsPIC33FJ64GP206

I've tried to re-write to the register, clear the bit etc and the disassembly looks good but it just isn't changing

Also, since changing the compiler version the new compiler has done some crazy stuff with my constant arrays so I've had to shift these to RAM in the meantime, can only address one problem at a time.

Typical Friday afternoon stuff
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Thu Dec 10, 2009 11:00 pm     Reply with quote

I learned with one of my projects that once the SPI is enabled, it won't accept config changes. (I was working on a PIC24F and was trying to change the prescalers).

Try disabling the SPI (direct register write) and then change the mode/settings.

I realize that may seem like a hack, but it may work.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D


Last edited by bkamen on Fri Dec 11, 2009 7:23 pm; edited 1 time in total
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Dec 11, 2009 12:21 am     Reply with quote

As far as I see, the "other" SPI method (setup_spi() ) is working with V4.103 as before. The new bug with #use spi is
apparently present for all 16 bit PICs.

It's curious to find a new bug without known changes in the version log... Christmas time at CCS.
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Dec 11, 2009 12:26 am     Reply with quote

FvM wrote:

It's curious to find a new bug without known changes in the version log... Christmas time at CCS.


Yay.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Guest








PostPosted: Fri Dec 11, 2009 5:02 pm     Reply with quote

and yet the version 4.085 I use prior did not have this bug.....it had a different SPI bug instead. Unfortunately I need the speed of the hardware SPI as I'm loading RGB images. Thanks heaps for the suggestion Ben, I'll give that a shot....much appreciated Smile .......Merry Xmas
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Fri Dec 11, 2009 7:24 pm     Reply with quote

Yea, I wish they'd hire FvM or someone PIC24 savvy to work on cleaning up the compiler.

It feels like they need more people working on PCD than they have.

Good luck and let me know how it goes.

-Ben

p.s. Make sure you submit as a bug to CCS support!
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 3:06 am     Reply with quote

I'm happy not to work too much in the embedded software business...

Also reporting bugs is basically work, that you're not paid for. So if you have found an acceptable workaround,
you don't necessarily file a bug report. As another point, your motivation will be influenced by the interest shown in
your previous reports.

At least v4.098 up to V4.101 didn't have the said bugs. As reported before, the "other" SPI method - and direct
usage of SPI hardware through SFR anyway - have been continously working.
Guest








PostPosted: Sat Dec 12, 2009 6:14 am     Reply with quote

Lot of problem is in the "devices4.dat" (4.102)
On 18FxxJxx I use an old one. My problem was, missing code from this statement
SETUP_ADC_PORTS(NO_ANALOGS);
missing in startup code too;


I know it posted wrong! You can delete is you want!
Langton



Joined: 29 Nov 2009
Posts: 25

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 11:44 pm     Reply with quote

Problem solved. I disabled the SPI as Bkamen suggested, changed the bits around and re-enabled the SPI and it works like a charm. Thanks heaps guys esp Bkamen, you're a legend in my books Very Happy
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Dec 13, 2009 2:35 am     Reply with quote

HA!

You crack me up. But thanks for the compliment.

:D Glad it's working now for you!

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group