hi, has anyone interfaced MCP2515 with ST10F269. i am facing issues with establishing the connection b/w the two. the CAN routines are fine (i suppose), but the SPI interface between the two seems to be the issue. Can anyone please post his/her code if any. This would be of very much great help... Thanks a lot in advance.
Rgds
So what "issues", exactly, are you facing?
What debugging have you done in an attempt to resolve those issues?
What did you discover?
Discovered that it didn't work.
And we discovered that your help request didn't work. No time to debug that help request any more.
Better start Debugging it, then...!
1. Check your design to see if hardware is OK. 2. Check power supply of MCP2515. 3. Check oscillator input of MCP2515. 4. Check SPI waveforms with a oscilloscope. See if your MOSI signals accords to datasheet and if MCP2515 responds to your MOSI signals.
thank u for the point Zhang. Let me be more specific... u c i have the below function to write a single byte to 82C900 via SPI. the µC is ST10F269, i am asked to reuse it because its a working snippet, but i am not finding this code appropriate. i checked if SPI is on external bus interface or memory mapped, but i didnt find any info in the datasheet. Can anyone help....
void WriteSingleSSCByte(WORD address,BYTE data) { int i; BYTE page; WORD lowaddress; unsigned char *pExCANMem; unsigned char *pPage; pPage = (unsigned char*)0x0F007C; pExCANMem = (unsigned char*)0x0F0000; lowaddress=(address&0x00FF); page=(((BYTE)(address>>7)) &0x0E );
do ; while(P3_7 ==0) ; *pPage = page;
do ; while(P3_7 ==0); *(pExCANMem+lowaddress)=data; }
in my personal view and limited experience i think i need to use the SSCTB and SSCRB and even SSCCON to enable the communication. but i was not able to find any such code. Is my understanding wrong or am i lacking some information.
You were talking about MCP2515, and now suddenly switched to 82C900. -_-||
We don't know what YOUR DESIGN REALLY IS. I hope you know it by yourself...
ARE YOU SURE YOUR HARDWARE IS ST10F269+82C900 ???? YES NO
sorry for the misconception but as i mentioned in the mail. my current requirement is to use MCP8515 instead of 82C900. i have a working code for 82C900 and has been asked to re-use the SPI part of it.
I have written the CAN controller routines for ST10F<-->MCP2515 and i believe its fine. now as per the requirement when i started re-using the SPI code (from 82C900), i was not able to figure out some difference which i mentioned in my previous post.
i hope i am clear. please excuse me if i confused you.
Well, you should confirm which uC-interface the former design used.
I'm not familar to ST10F, but your pasted code looks like accessing external parallel very much...
82C900 has two different types of interfaces: Parallel and SSC. The wiring and programming upon these two interfaces are quite different.
If your former design used SSC, then it's compatible with basic SPI and could be able to transfered to MCP2515 with some modifications. But if not, it'll need a whole rebuild of the soft (driver layer and mid-layer).
Who asked you?
Have you discussed this with them?
Hello Andrew,
I am sorry if i sound odd but, dont you think your question is out of scope. I believe that it's an internal issue and we should (if possible) concentrate on the problem i mentioned (if clear). Anyways i would like to thank Ejack Zhang for putting some light. his single statement made me dig into the EBI of ST10F and i believe i will find something to start with. I would really appreciate any valuable points from your side.
The main problem is that the H/W is not available with me right now, thats why i am struggling and once the H/W reaches, time crunch will b there.
I've checked ST10F269's datasheet and user manual.
To my astonishment, I found that ST10F269 already include two CAN 2.0B controllers!!! So till now, to my limited knowledge, I think IN NO CASE SHOULD YOU ADD A MCP2515 TO A ST10F269 APPLICATION, ONLY IF YOU ARE JUST KIDDING OR BEING KIDDED BY YOUR BOSS.
Dude, today is not 1st, April...
oh comeon Zhang. i am not kidding, do you think since ST10F269 has two CAN modules that means no application in this embedded world should use an extra CAN interface. But yes, as u mentioned the term "limited knowledge" :) let me tell you that this product is to be installed in an aircraft which plays with 3 CAN interface also a hell lot of ARINC messages.this 3 CAN (via MCP2515) just forms only the 3% of the whole system. My knowledge may be much much less limited than your but i am working for this so that means there is at least one practical situation where its needed :).
Not really:
Nobody here knows you or your project but, presumably, this person does know you and does know what you're working on - so they would be the ideal person to seek informed guidance.
Also, since this person gave it to you, they must have had some reason(s) to beleive that it would help you - and only they can explain to you what those reasons may be...
Hi andrew,
Do u really think that the conversation we are having is necessary. i am just seeking help in interfacing ST10F269 and MCP2515, keeping the reference as a working code snippet for 82C900. i have mentioned the issue about my understanding of the code snippet i pasted. Is this application impossible enough that i should question my boss about "why" this is required.
is there any prerequisite for asking questions in this forum, except that the questoner should be sane and the question whould be relevant to the concerned MCU architecture.
I am sorry if i asked something really really silly.
Rgds and thanks a lot.