Author |
Message |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Fri Apr 17, 2009 7:10 pm Subject: H/W SPI on a pic24 |
OK I really have no words to thank you enough FvM.
I've been pulling my hair trying to make this work for a month now. You did it man!
Oh the joy!!!!
Thank you so much!!!!!!
THANK YOU! |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Fri Apr 17, 2009 9:29 am Subject: H/W SPI on a pic24 |
Sorry I'm an idiot.
#include "C:\...hw.h"
#PIN_SELECT SDI1=PIN_D1
#PIN_SELECT SDO1=PIN_D2
#PIN_SELECT SCK1OUT=PIN_D3
#PIN_SELECT U2TX=PIN_F5
#PIN_SELECT U2RTS=PIN_F4
#use rs23 ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Thu Apr 16, 2009 6:05 pm Subject: H/W SPI on a pic24 |
The code:
#include "D:\...hardware.h"
#PIN_SELECT SDI1=PIN_B6
#PIN_SELECT SDO1=PIN_F5
#PIN_SELECT SCK1OUT=PIN_G6
#PIN_SELECT U2TX=PIN_F5
#PIN_SELECT U2RTS=PIN_F4
#use rs2 ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 15, 2009 6:12 pm Subject: H/W SPI on a pic24 |
And here's some proof that the comms are fine (although I can't read the response)
http://farm4.static.flickr.com/3556/3446248588_5d2e379f51_b.jpg
I've also learned that #use spi won't work wi ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Sat Apr 11, 2009 6:28 pm Subject: H/W SPI on a pic24 |
Lol of course not . I've done so many changes trying to make this work that it's hard to find a file with correct code any more. Sorry for that. I don't even remember the reason why I switched to sp ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Sat Apr 11, 2009 5:32 pm Subject: H/W SPI on a pic24 |
I have too tried pins D1, D2, D3, G8, G7 with no luck (no compiler errors). I don't believe its a pin problem as pps works fine with the serial port. Also I've tried manually setting I/O direction.
... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Thu Apr 09, 2009 6:41 pm Subject: H/W SPI on a pic24 |
The loopback test failed as well. I still get zeros. And I've tried different pins too. :(
FvM could the fact that I'm using the internal osc have anything to do with it? Doesn't sound likely but I ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Thu Apr 09, 2009 4:35 pm Subject: H/W SPI on a pic24 |
But, you see the accelerometer is responding, so if it's a hardware issue it must be PIC's
The loopback is a very good idea! |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Thu Apr 09, 2009 3:48 pm Subject: H/W SPI on a pic24 |
What's going wrong then? It's driving me mad. Why doesn't it read a perfectly sent response? I really don't want to switch back to C30! I hate c30! |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Thu Apr 09, 2009 1:03 pm Subject: H/W SPI on a pic24 |
Ok I think I've done whatever there is to do to make this work (at least for a newbie).
I just don't get it.
This code:#include "D:\...hardware.h"
#PIN_SELECT SDI1=PIN_G8
#PIN_SEL ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 08, 2009 8:57 pm Subject: H/W SPI on a pic24 |
Dear Fvm,
Thank you for your reply.
Could you please clarify for me the following;
What exactly SPI_CPHA_0 is doing?
How did you find out that RPI45 was not working with pin_select? Did you get an ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 08, 2009 2:34 pm Subject: H/W SPI on a pic24 |
Dear Guest,
I just happened to name my c file spi so spi.h was the file generated by the wizard.
The reason I am used two spi_read is that if I tried with one write and one read (as it would be th ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 08, 2009 1:26 pm Subject: H/W SPI on a pic24 |
Are you working with an accelerometer too? I actually need to implement two spis (like one was not enough); one between the accelerometer and the gb106 one between the gb106 and another pic.
The go ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 08, 2009 1:06 pm Subject: H/W SPI on a pic24 |
So are you using SPI1BUF then to send something or spi_write? What are you trying to communicate with?
Have you tried the second code I posted? That doesn't doesn't even generate a clock?
I don ... |
Topic: H/W SPI on a pic24 |
geokonst
Replies: 36
Views: 60892
|
Forum: General CCS C Discussion Posted: Wed Apr 08, 2009 10:29 am Subject: H/W SPI on a pic24 |
Thank you.
In the meanwhile could you please post the version of your code that writes directly to the control registers to give it a go?
cheers |
|