View previous topic :: View next topic |
Author |
Message |
jmaudley
Joined: 01 Feb 2011 Posts: 32 Location: 53
|
HW SPI |
Posted: Wed Sep 14, 2011 10:05 am |
|
|
Hi, - I'm new to the CCS compiler and programming in C, but not new to programming PICs.
I'm trying to drive an HCMS-2963 display using the SPI interface.
I'm using a 16f876a chip and pins are configured correctly for hardware SPI implementation.
I've read the manual and #use spi seems to be quite simple (unless I'm missing the point).
My understanding is that once I have set the following line:
Code: |
#use spi (FORCE_HW, BITS=8, STREAM=SPI_STREAM)
|
All i need to do is:
To send out my data.
Am I correct in saying that #use spi handles all of the configuration or do I need set the appropriate registers.
If anybody could point me in the direction of some code examples that would be really helpful.
Any assistance would be appreciated. Thx
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 14, 2011 12:16 pm |
|
|
Whether or not #use spi() works, or also, what specific parameters are
required, is highly dependent upon your compiler version. Please post
your version. |
|
|
jmaudley
Joined: 01 Feb 2011 Posts: 32 Location: 53
|
|
Posted: Thu Sep 15, 2011 1:20 am |
|
|
I'm using the PCWH compiler
IDE 4.107
PCB 4.107
PCM 4.107
PCH 4.107 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
jmaudley
Joined: 01 Feb 2011 Posts: 32 Location: 53
|
|
Posted: Fri Sep 16, 2011 1:38 am |
|
|
Thanks for the advice.
I'll give that a try. |
|
|
jmaudley
Joined: 01 Feb 2011 Posts: 32 Location: 53
|
|
Posted: Fri Sep 16, 2011 7:57 am |
|
|
Got it working (my first C project).
Good to know I'm not on my own.
PCM programmer - thx for taking the time to help. |
|
|
|