Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 09:23:25 21:23


Login with username, password and session length


Pages: [1]
Print
Author Topic: made spi with codevision but have error please help  (Read 1648 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, 10:07:39 10: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: 42

Thank You
-Given: 24
-Receive: 18

All is Well


« Reply #1 on: December 19, 2011, 01:05:03 13: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, 07:48:54 07: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, 08:55:33 08: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