Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SPI setup
26-04-2012, 09:09 PM, (This post was last modified: 26-04-2012, 09:26 PM by pingotg.)
#21
RE: SPI setup
Dale,

No, I don't think you screwed up. And you don't actually need MSSEN. Just seemed cool if it was there. You also don't need framing, I think.

Looking at Lucio Di Jasio's book on the PIC32, he has a simple example using SPI2 and a 25LC256 serial memory. He uses 0x8120 for SPI2CON, reduces the SPI clock to 1/16 of FPB (which he has at 9MHz as his PIC32 is 72MHz) so about 280kHz.

For such a simple device it's very simple code. The main gotcha seems to be that every write has a corresponding read (he does it in the function for write) and to just do a read you need to write a dummy (say, zero).

If you have one of those kinds of memory, maybe test with it?

He's not using MSSEN but it may be that it didn't even exist back when he was writing the book.

edit: Aha try http://www.exploringpic32.com/resources/SEE.zip

John
Reply
27-04-2012, 01:14 AM,
#22
RE: SPI setup
Thanks, I don't SEE Wink where he needs to pull SS down when he communicates like I do.

I am making some progress here, it seems that I did not get looping my temperature request from the 6803 fast enough after I sent the config register to the 6803 in my setup function where I have a delay for that I2C startup issue.

The 6803 has has a WDT that shuts itself down if you have not communicated with it for 1 second. Kinda hard to answer the door if you are not listening, oh well.

After I confirm this was the last problem I will declare the second half of my Bingo.

Dale
PIC32-Pinguino-OTG Rev C and PIC32-PINGUINO-MICRO rev.B
Win XP SP3
r381 x.3 Big Grin
AND spi.c {} error fixed
AND sdmmc.c pin error fixed
AND diskio.c fixed, MICRO can't use the RTCC
AND analog.c fixed for MICRO
Reply
27-04-2012, 03:14 AM,
#23
RE: SPI setup
Still not all the way there.

The WDT was a problem, fixed that, and have confirmed that my Config register writing into the 6803 is working and in that register I can set a bit to turn on an LED so I know I am communicating, it is just not talking back to me. I will get there yet. I am getting some support from Linear now which is great, I hope they give me some suggestions tomorrow Tongue

Dale
PIC32-Pinguino-OTG Rev C and PIC32-PINGUINO-MICRO rev.B
Win XP SP3
r381 x.3 Big Grin
AND spi.c {} error fixed
AND sdmmc.c pin error fixed
AND diskio.c fixed, MICRO can't use the RTCC
AND analog.c fixed for MICRO
Reply
27-04-2012, 08:25 AM,
#24
RE: SPI setup
Hooray, progress!

I think SS from the PIC just becomes CS on the slave, and most chip selects are active low (CS/ or CS* or #CS or CSN or nCS seems there are too many ways to show that).

Or did you mean something else?

John
Reply
29-04-2012, 02:18 PM, (This post was last modified: 29-04-2012, 02:19 PM by KiloOne.)
#25
RE: SPI setup
John,

Ignore my previous SEE comment.

Yes SEE is right on the money, thanks.

BINGO complete!!! Big Grin

The SDO answer was so simple but hard to find.

Basically, I assembled my 6803 board with an incorrect wrong part on it.

I was supposed to use an SI8441 quad isolator on the serial lines and I inadverently used an SI8440. The 8441 has 3 outputs and 1 input, the 8440 has 4 outputs.

So, the open drain NMOS SDO line with its 3.3k pullup was driving into an output. The SI84 series of isolators use RF as their isolating technique not optical and for some reason the 8440 kept the SDO line high even when the 6803 was trying to drive SDO low.

The error began when I created the Labcenter ISIS part to place in my schematic. I used a library SI8440 part as a starting point and changed everything except the Digikey part number which does not contain any text which would have helped me recognize the error. So, from that point on, the wrong part was destined to be ordered. I missed the error when I received the part and also when I soldered it on the board. The chip has markings so faint that you can barely see the part number even under 10x mag.

I found the error when I was looking closely for solder bridges and noticed the incorrect part #.

So I think this saga is complete for now.

Thanks for all your help John, sorry to have wasted everyones time too.

But I am sure that this post highlighting my incompetence will help others to come.

Dale
PIC32-Pinguino-OTG Rev C and PIC32-PINGUINO-MICRO rev.B
Win XP SP3
r381 x.3 Big Grin
AND spi.c {} error fixed
AND sdmmc.c pin error fixed
AND diskio.c fixed, MICRO can't use the RTCC
AND analog.c fixed for MICRO
Reply
29-04-2012, 05:09 PM, (This post was last modified: 29-04-2012, 05:10 PM by KiloOne.)
#26
RE: SPI setup
One last comment for those that follow me.

If you are trying to get an SPI connection to read data at high speeds, don't ignore the SMP bit in the SPIxCON register.

At SMP set to 0, I was able to get the PIC to parse incoming data at 250khz but not at 1mhz.

Set SMP to 1 and it works now at 1mhz. Big Grin

Dale
PIC32-Pinguino-OTG Rev C and PIC32-PINGUINO-MICRO rev.B
Win XP SP3
r381 x.3 Big Grin
AND spi.c {} error fixed
AND sdmmc.c pin error fixed
AND diskio.c fixed, MICRO can't use the RTCC
AND analog.c fixed for MICRO
Reply
29-04-2012, 07:36 PM,
#27
RE: SPI setup
I'm glad you found it!

Got to be good to have it working Smile

John
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)