v5.00 SPI help can be more consequent.

Beta Testing discussion on mikroPascal PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

v5.00 SPI help can be more consequent.

#1 Post by Dany » 23 Jul 2011 19:36

The current help says about SPIx_Init:
Prototype procedure SPIx_Init();
Description Configures and initializes the SPI module with default settings.
Default settings:
Master mode
8-bit data mode
...
Serial output data changes on transition from active clock state to idle clock state <-- this line

The last line is true, but it would be better to say "Data is valid on IDLE-to-ACTIVE transition" as stated a little bit further:
Clock Edge
Description Predefined library const
Data is valid on ACTIVE-to-IDLE transition _SPI_ACTIVE_2_IDLE
Data is valid on IDLE-to-ACTIVE transition _SPI_IDLE_2_ACTIVE
Even better is (in both places):
Output Data is valid on IDLE-to-ACTIVE transition
Thanks in advance!
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: v5.00 SPI help can be more consequent.

#2 Post by jpc » 23 Jul 2011 20:21

would it be possible to limit this type of posting to a single forum ?
Au royaume des aveugles, les borgnes sont rois.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: v5.00 SPI help can be more consequent.

#3 Post by Dany » 24 Jul 2011 08:23

jpc wrote:would it be possible to limit this type of posting to a single forum ?
I am very sorry to be obliged to post in more than one forum, but my experience is that, if a problem has been solved for a certain compiler, it is not necessarely the case for others... :(
Furthermore, the content of the posts are rather different for "PIC" and "dsPIC30/33 and PIC24". :?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: v5.00 SPI help can be more consequent.

#4 Post by filip » 25 Jul 2011 10:05

Hi,

According to the dsPIC/PIC24 datasheet :
Serial output data changes on transition from active clock state to Idle clock state.
Serial output data changes on transition from Idle clock state to active clock state.
So, you think that we should change descriptions a little bit, in order to be more understandable ?

Regards,
Filip.

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: v5.00 SPI help can be more consequent.

#5 Post by Dany » 25 Jul 2011 11:40

filip wrote:According to the dsPIC/PIC24 datasheet :
Serial output data changes on transition from active clock state to Idle clock state.
Serial output data changes on transition from Idle clock state to active clock state.
Indeed, but the "edge" parameter in "SPIx_Init_advanced" is the "data valid" edge, the opposite of the "data change edge" as used in the datasheet, so be carefull.
filip wrote:So, you think that we should change descriptions a little bit, in order to be more understandable ?
Indeed, please (continue to) use the "data valid" edge definition (as you do already when describing the "edge" parameter values):
Output Data is valid on ACTIVE-to-IDLE transition: _SPI_ACTIVE_2_IDLE
Output Data is valid on IDLE-to-ACTIVE transition: _SPI_IDLE_2_ACTIVE
I did some measurements and "SPIx_Init_advanced" always (for P18 and P24, ??) uses the "data valid" SCK edge (between 2 "data change" edges). This is a much better choice than the one in the datasheet.

Thanks in advance. Keep up the good work! :D :D
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroPascal PRO for dsPIC30/33 and PIC24 Beta Testing”