Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPI on atmega2560 didnt work in master mode?

Status
Not open for further replies.

hassanmd

Member level 1
Joined
May 31, 2007
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,554
hi
i have used SPI on atmega16 with sd-card and it works fine. now i am shifted to 2560. the MASTER_INIT() function as describe in datasheet of 2560 , i used the same function. when i SIMULATE the code in avr-studio, the SPE ,MSTR and SPR0 is set. but as soon as program cursor step out side the initialization function and execute next instruction MSTR becomes 0.

it actually works something like a slave in real time on stk600. i am using avr studio 4.
on stk600 i continously checked the SPI transmit flag, it remain in that loop forever but as soon as i connect the SCK pin with open wire the flag turn high . in fact i am toggeling the LEd after that loop. also when i tried to check the waveform of SCK pin on oscilloscope and as soon as i connect the ground pin of osciloscop to the ground of STK600 it shows he same respose as with open wire.



plz help
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top