Topics Topics Edit Profile Profile Help/Instructions Help Member List Member List  
Search Last 1|3|7 Days Search Search Tree View Tree View  

PIC 18F family - Actual use of WCOL f...

:: EPE Chat Zone ­:: ­Radio Bygones Message Board :: » EPE Forum Archives 2010 - » Archive through 08 September, 2012 » PIC 18F family - Actual use of WCOL flag (SSPCON1,7) « Previous Next »

  Thread Last Poster Posts Pages Last Post
  ClosedClosed: New threads not accepted on this page        

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

atferrari
Frequent Contributor
Username: atferrari

Post Number: 1254
Registered: 05-2005


Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, 02 August, 2012 - 07:51 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

SPI - Micro has to transmit only.

I couldn't find a good (practical) use for the WCOL flag (Write collision detect bit).

The way I understand it, I should first write to SSPBUF and then check that flag to see if I was allowed to write. Kind of: "do it and I will tell you if you did right or wrong".

I expected to have a "busy" flag, pretty much like the one in the classic LCD displays that when it is cleared, you know you can go ahead with the next byte.

Is my interpretation wrong?
Agustín Tomás - Buenos Aires - Argentina
Top of pagePrevious messageNext messageBottom of page Link to this message

bowden_p
Frequent Contributor
Username: bowden_p

Post Number: 123
Registered: 01-2006

Rating: N/A
Votes: 0 (Vote!)

Posted on Wednesday, 15 August, 2012 - 10:47 pm:   Edit Post Delete Post Print Post    Move Post (Moderator/Admin Only)

Hi Agustin,
I think you understand the WCOL bit correctly - its use is to detect an error in the use of the SSPBUF register.
Better to use the SSPIF flag for checking if the SPI interface is ready to transmit the next byte. This flag gets set when the current byte has been completely sent. You could use an interrupt routine, or poll the flag.
(I don't think there is an SPI "busy" flag of the type you describe as available with an LCD display.)
With regards, Paul.

Administration Administration Log Out Log Out   Previous Page Previous Page Next Page Next Page