Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 26, 2024, 12:26:14 12:26


Login with username, password and session length


Pages: [1]
Print
Author Topic: made spi with codevision but have error please help  (Read 3930 times)
0 Members and 1 Guest are viewing this topic.
abdullahshawky
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 8
-Receive: 19


« on: December 19, 2011, 09:07:39 09:07 »

hi guys

i made a project for spi between 2 controllers 1 master as reciever and 1 slave as transmitter

when i put the SPDR of both in a while(1) loop it works correctly but proteus gives a warning message about collision of data

when i put thr SPDR in the spi interrupt it stops the collision and sends the data shifted and 1 added to it

ex when i send 0 i get 1 when i send 1 i get 3 and so on

attached is 2 foleders with code and proteus simulation files please correct my error so that i can use spi in interrupt

thanks please help this time
Logged
BharatSujanani
Junior Member
**
Offline Offline

Posts: 48

Thank You
-Given: 31
-Receive: 24

All is Well


« Reply #1 on: December 19, 2011, 12:05:03 12:05 »

Hi
I have faced the problem like you in which i also get data shifted.When i send 0XAA, i will get 0X55. If this is the problem then it is due to the SPI mode confliction between Master and slave. SPI has 4 modes to operate.
Check that 4 modes your problem would be solved.
Logged

Bharat Sujanani
abdullahshawky
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 8
-Receive: 19


« Reply #2 on: December 21, 2011, 06:48:54 06:48 »

i thank u for even caring to respond

thats why i like sonsivri members

on other forums this exact post only got me mocked at as if all people where born educated and know all stuff

i will look into ur solution and if it work i will add the project  for newbies (like me)
Logged
abdullahshawky
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 8
-Receive: 19


« Reply #3 on: December 22, 2011, 07:55:33 07:55 »

Dear friend,

i tried using spi mode 1 istead of mode 0 and the problem got solved thaks alot i will make a full project and upload it to sonsivri so that all get some tips

thanks again
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC