We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear All,
I am new in prograqmming the 89LPC639 and with the keil uvision version 3. The problem that i face is that, when i try to start the SPI seems nothing happened. First the SPDAT does not take the value that i try to put in. Second in logic analyzer at pins which are for the SPI protocol nothing occurs. I could not know what i am making wrong so i hope a advance user could help me with that.
Also i am include the code.
void Spi_Send(unsigned int value){
P2|=0x34; P2M1 |= 0x34; P2M2 = 0x34; SPSTAT |= 0x80; SPCTL=0xD0; SPDAT=value;
while ((SPSTAT & 0x80)==0){ }
}
... free from http://www.esacademy.com as (a base for) your code.
Erik
Dear Erik,
Is it possible to do the same thing without the usage of interrupts? I try to avoid the interrupts because i am not familiar with them yet.
Is it possible to do the same thing without the usage of interrupts? sure, if you want your process to come to a screeching halt.
I try to avoid the interrupts because i am not familiar with them yet. STOP what you are doing and get "familiar with them". trying to get by without interrupts "because i am not familiar with them yet" will do two things 1) pretty soon force you to recode the whole mess 2) give you some very nasty habits
Interrupts are not complex, they are the main device to keep embedded systems running "on time'
PS the ready made code from CodeArchitect does it for you