AnsweredHot![worked around]Microchips PIC SPI is non-complient wrt slave select, makes it useless

Page: < 123 > Showing page 2 of 3
Author
fourtytwo
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2017/06/23 05:27:25
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 09:57:32 (permalink)
4 (2)
AAAAHHHHHHHHHHHHHHHHHHHH WOWWWWWWWWWWWWW
I just turned off frame mode and it stutters the clock OMG!!
 
OK so thats a different but feasible way to work :)
 
Yup just counted 16 rising edges perfect, now I dont care what SS does and I understand how and why you guys are able to drive it in software!!
 
Choking on humble pie here, so answer is NEVER set frame mode!!
 
Thank you very much for your persistence to the nice ones!
post edited by fourtytwo - 2017/11/10 10:10:04

Attached Image(s)

#21
mlp
boots too small
  • Total Posts : 523
  • Reward points : 0
  • Joined: 2012/09/10 15:12:07
  • Location: Microchip XC8 and XCLM team
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:04:06 (permalink)
4.33 (3)
DavidBLit
fourtytwo
... <directed at Dario>
perhaps you are not familiar with SPI or hardware in general.
...

I had to laugh at that one!  Where do they find these arrogant clowns?

I think there's a sale happening at Arrogant Clowns-R-Us, or maybe somebody made a bulk purchase.

Please, before you post, read the Forum Guidelines
To get a useful answer, always state which PIC you are using!
 
Mark (not paid to state the opinions of Microchip Technology Inc.)


#22
JPortici
Super Member
  • Total Posts : 151
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: 0
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:07:39 (permalink) ☄ Helpfulby fourtytwo 2017/11/10 10:14:57
4 (1)
DarioG
(Framed mode resembles somehow I2S or alike audio protocols...)



Read in this forum that Framed mode was put to have a poor man's version of I2S :) looking at the datasheet the SS pin in framed mode is operating as it should, a single pulse to tell the device where the start of frame is
 
If the OP want to automate the whole mechanism, i like to use when i can a CCP/PWM module to generate the pulse. Start of pulse triggers DMA transfert to SSPBUF, END of SPI transfert triggers a DMA transfert from SSPBUF to memory.
Just be careful with the timings and all should be OK (haven't seen a failure yet)
#23
jtemples
Super Member
  • Total Posts : 10290
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:17:09 (permalink)
5 (5)
I think this might be my new favorite arrogant clown thread, beating this one:
 
http://www.microchip.com/forums/m1001499.aspx
 
perhaps you are not familiar with SPI or hardware in general.

 
I think this line will become famous on the forum.
#24
Jim Nickerson
User 452 _
  • Total Posts : 4357
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: online
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:21:22 (permalink)
4.67 (3)
Quoted to preserve the original ( in case it gets edited away )
fourtytwo
I have just started to use the PIC24EP256MC202 an important part of the selection criteria being this had a 16 bit capable SPI interface for driving external DAC's.  If you check both the accepted industry standard (e.g. Wiki) or the data sheet for a common SPI DAC (e.g. MICROCHIP MCP4921) you will discover slave select should be active during the entire SPI transfer.
 
It seems however Microchip are non-compliant as there slave select in master mode is only active for a single clock period!
 
On what basis are you selling these chips as containing an SPI interface when it is dysfunctional ?
What work-around do you have for this problem that does not require wait loops in software ?
Why is this issue not dealt with in the silicon errata ?
 
The attached scope shot shows slave select with a 16 bit data frame 0x200F, clock speed is 1.25Mhz
 




#25
fourtytwo
New Member
  • Total Posts : 13
  • Reward points : 0
  • Joined: 2017/06/23 05:27:25
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:23:10 (permalink) ☄ Helpfulby Jim Nickerson 2017/11/10 10:24:23
2.33 (3)
jtemples
I think this might be my new favorite arrogant clown thread, beating this one:
 
http://www.microchip.com/forums/m1001499.aspx
 
perhaps you are not familiar with SPI or hardware in general.

 
I think this line will become famous on the forum.


Pathetic
#26
NorthGuy
Super Member
  • Total Posts : 4589
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:35:57 (permalink)
3 (1)
fourtytwo
Once again how to do that synchronously with a presently 1.25Mhz clock that I was hoping to raise to 5Mhz.  I wonder what is that fastest you have driven a DAC from the PIC SPI port ?



You can do faster than that. Your PIC is capable of 15MHz in master transmit-only mode according to the datasheet.
 
In the master mode, the timing of the SPI is absolutely predictable, so you just use SPI without SS, then you use a PWM module to generate SS signal. You use DMA to create continuous SPI transmit. Then you match the timing of PWM to the SPI. It is easy to do with a scope and some experimenting.
 
If you don't want to bother with PWM, you simply create a timer interrupt. At every interrupt you pulse SS as needed then send the SPI word. If your SPI clock is 15MHz and you send 16-bit words, you need an interrupt a little bit slower than 1MHz - it's not too taxing for this PIC.
 
#27
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:39:11 (permalink)
0
20MHz SPI... 2 byte transfer... circa 1.25Msample/sec max @12bits. Not bad, but a parallel DAC may be better if such performance is needed.

forget about me, subhumans. adieu

#28
NorthGuy
Super Member
  • Total Posts : 4589
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:50:25 (permalink)
4 (1)
dsPIC33EPxxxGSxxx come with built-in 12-bit DACs (some of them even have two DACs).
#29
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:55:34 (permalink)
0
Do they have USB too? I suppose not but let me check - could be nice for my Function Generator Smile

forget about me, subhumans. adieu

#30
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 10:58:35 (permalink)
0
Yes it does!
dsPIC33EP512MU810 is from same family like the PIC24EP512GU810 that I used!
I only need to find someone soldering it for me... ;)

forget about me, subhumans. adieu

#31
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:13:11 (permalink)
0
Hmmm, now I don't want to hijack this thread, but...
the 2 PICs I listed above are shown in MAPS as "having a DAC" but their datasheet mentions nothing about it...
 
(funny is, if you ask for "at least one DAC module", you get those 2 PICs; but if you also ask for "a DAC output" they disappear... !!! Is it an internal DAC? Are they talking about the Comparator?)

forget about me, subhumans. adieu

#32
jtemples
Super Member
  • Total Posts : 10290
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:25:43 (permalink)
4 (1)
I just specify the number of DAC bits in MAPS, not any of the other DAC selections.  If you enter 12, you only get the two GS families, and the DAC is "hidden" inside the comparator.
#33
NorthGuy
Super Member
  • Total Posts : 4589
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:33:23 (permalink)
3 (1)
DarioG
Do they have USB too? I suppose not but let me check - could be nice for my Function Generator



PIC32MK?
#34
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:40:01 (permalink)
0
I see,
and no, this is not a real project but just some funny project at home Smile so I wanted to use a little board we already developed for CAN. At the moment I am using PWM for generating sine, triangle etc, as for this thread
http://www.microchip.com/forums/m1021922.aspx
 
A real DAC would improve the result, but it's not important. If this ever becomes a real product, we'll see!
 
thanks everybody

forget about me, subhumans. adieu

#35
vjasinski
Super Member
  • Total Posts : 104
  • Reward points : 0
  • Joined: 2013/04/30 11:48:06
  • Location: Michigan, USA
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:48:50 (permalink)
4 (1)
Speaking of SPI and waveform generation, we use the AD9837 for triangle wave generation. Made for sine wave, and will also do square. SPI clock up to 16MHz!
#36
crosland
Super Member
  • Total Posts : 1102
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Bucks, UK
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 11:51:01 (permalink)
4.67 (3)
fourtytwo
crosland
No, it is you who has failed to understand the PIC24 datasheet.
 
Look at The SPI chapter of the PIC24 Family reference Manual DS70005185A page 14 "In Master mode, the SPIx module does not control the SSx pin. This pin should be configured as a General Purpose I/O (GPIO) by clearing the SSEN bit (SPIxCON1<7>) = 0."
 
The Slave select function of the SS/FSYNC is only used in slave mode. What you are looking at is the frame sync pulse output on the SS/FSYNC pin in master mode.


And so as you correctly point out it is non-compliant because it is apparently unable to generate a compliant slave select signal in master mode!




You just dont get it.
 
Think about it. In the general case an SPI master is connected to multiple slaves, each with their own SS driven by the master. Only the software running on the master can know which SS to assert for any transfer. A master that always asserts a single SS is as much use as a chocolate teapot.
 
The only "compliance" the SS needs is to meet the setup time to the first clock edge, the hold time after the last clock and the minimum high time, Tccsr, Tchs and Tcsh for the MCP4921. The SS plays no active part in clocking the data, it is merely an enable.
 
It's up to YOU to generate a "compliant" SS.
#37
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 12:01:27 (permalink)
0
vjasinski
Speaking of SPI and waveform generation, we use the AD9837 for triangle wave generation. Made for sine wave, and will also do square. SPI clock up to 16MHz!




Ah yes I know, I used that too!
But a "full software" solution is more flexible - think of direct or inverted sawtooth, or white/pink noise...

forget about me, subhumans. adieu

#38
NorthGuy
Super Member
  • Total Posts : 4589
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 12:06:06 (permalink)
0
DarioG
and no, this is not a real project but just some funny project at home



I also want to build a function generator as a hobby project. Actually, I wanted to build a scope, and the function generator would be sort of a learning step - I don't have any experience with fast analog, so I don't want to screw up something when working with expensive ADCs. I have already selected a good DAC - LTC2000. But I don't think it'll ever happen - too much work, too little time :(
 
#39
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: MIcrochips PIC SPI is non-complient wrt slave select, makes it useless 2017/11/10 12:09:36 (permalink)
0
Ok, so you gave me a reason to publish my code (if forum allows me to...)
but let's start a new thread!

forget about me, subhumans. adieu

#40
Page: < 123 > Showing page 2 of 3
Jump to:
© 2017 APG vNext Commercial Version 4.5