SPI SOLVED
bbrien
Posts: 561
Since I have had no luck with Serial and I2C with the propeller using Prop C and Spin Can anybody help with two propeller spi.
Comments
I find the best interface is serial and for many purposes you really only need a single half-duplex line if the communications is in the form of command/response. There are many examples of all kinds of serial drivers on the forum and the obex and in the C libraries. Rather than how you think you might achieve it perhaps the important question is "what are you trying to achieve"?
My guess is that you still do not run the P1 at its 'standard' 80Mhz, thus your problem with serial. This might be your important info you are missing.
So instead of switching to I2C SPI or anything else, just get serial running, then start to write your program around it.
Enjoy!
Mike
There is nothing wrong with your P1 boards. BTW, stop trying to slow it down, leave it at 80MHz. Serial works, always has, always will, but you are the one having the problem then you are the one that needs to provide full information, that is, all your code, your setup, any photos that may help etc. Then, and only then can we see or try out what you have done and go "aha! that is your problem".
My first MCU was the Prop development board + Bluetooth module. I wanted to try communicating with my Android tablet. Had no clue about Spin and so I cut/pasted from examples and it was up and running instantly. Spent the rest of the day playing with the Android code.
Here's a scope capture:
1. Yellow = test pulse at 50Hz
2.
3. NS DIR
4. NS PULSE
What is "longcon" in your code?
You did --nav to init this variable which only predecremented it. You needed nav~~ to set it to all 1's since you were &= to latch them low.
EDIT: I've just come back to look at this again as I didn't have much time before. Here is your version fixed up although I don't see where you use the "serial" function.
EDIT: removed my test version and replaced this code with the original + fixes
BTW - Your code was not sending serial data anywhere. The "serial" routine was not being called and nowhere else were you sending data. That's why it's always a good idea to put in a startup message.
However, lacking your current version which you still haven't sent, here is one that will produce an output although you still need to call your "serial" routine from inside main if you want that to work.
If you ever want any real help you need to say what you can and can't do, what you do and you don't have and know etc. If you are upfront you will save yourself and others a lot of wasted time.
If you have links to websites which you are looking to for that information, then please supply those links too. While we are not sitting around with nothing to do, we do love to help, but we are not psychics, you have to tell us what you can. Even let us know why you are doing it and what you hope to achieve.
Pretty much lay it all out on the table and let us decide which part is important or not and then I am pretty sure that you will have your telescope drive up and running in very short time.