View previous topic :: View next topic |
Author |
Message |
Langton
Joined: 29 Nov 2009 Posts: 25
|
Suspect SPI bug in 4.103 |
Posted: Thu Dec 10, 2009 8:49 pm |
|
|
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
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: 1615 Location: Central Illinois, USA
|
|
Posted: Thu Dec 10, 2009 11:00 pm |
|
|
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
|
|
Posted: Fri Dec 11, 2009 12:21 am |
|
|
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: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Dec 11, 2009 12:26 am |
|
|
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
|
|
Posted: Fri Dec 11, 2009 5:02 pm |
|
|
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 .......Merry Xmas |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Dec 11, 2009 7:24 pm |
|
|
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
|
|
Posted: Sat Dec 12, 2009 3:06 am |
|
|
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
|
|
Posted: Sat Dec 12, 2009 6:14 am |
|
|
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
|
|
Posted: Sat Dec 12, 2009 11:44 pm |
|
|
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 |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sun Dec 13, 2009 2:35 am |
|
|
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 |
|
|
|