CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Looking for example code MCP23S17 SPI writing to GPIO

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sandeepvd



Joined: 29 Dec 2006
Posts: 2

View user's profile Send private message

Looking for example code MCP23S17 SPI writing to GPIO
PostPosted: Fri Dec 29, 2006 8:11 pm     Reply with quote

[b]I am beginner.

Looking to write outputs to MCP23S17 io expander GPA and GPB separately using PICDEM FSUSB (PIC18F4550) in SPI mode with C18 library?
(A2 A1 A1 is = 000)

Can someone be kind enough to help ?[/b]
__________________________

more sp info if it takes:

PIC18F4550 MCP23S17
RB0 (SDI) SO
RB1 (SCK) SCK
RC7 (SDO) SI
RA4 CS

taking PICDEM FSUSB demo program as reference.
TRISC<7> bit to be cleared for SDO
TRISB<1> bit to be cleared for SCK (Master mode)
TRISA<4> bit to be cleared for CS

A0 A1 and A2 of MCP23S17 are grounded.

Have looked at MCP23S17 tables but some example help on correctly configuring it's GPIO and config reg appreciated. (I could only figure out that 0x40 for writing to the device :( )
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group