AN 1776

"kshanthi03" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>

Hi,
i am trying to implement This AN 1776 application notes Stereo Audio 
Transmission Over The CAN Bus Using The Motorola MPC 555 With TouCAN 
Module.
 in the toucan.c module the function set_ip;an assemberler 
instruction is requried to access the satatus register. i am using 
VISUAL-X tools complier.

when i am trying to compile this code

void set_ip (int ip)
{
switch (ip) {
case 0: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF0FF,SR" ); 
break;

case 1: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF1FF,SR" ); 
break;

case 2: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF2FF,SR" ); 
break;

case 3: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF3FF,SR" ); 
break;

case 4: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF4FF,SR" ); 
break;

case 5: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF5FF,SR" ); 
break;

case 6: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF6FF,SR" ); 
break;

case 7: default: asm(" ORI.W #0x0700,SR",
" ANDI.W #0xF7FF,SR" ); 
break;
}

the error is :argument of asm is not constant string,
then i try to write like this 

case 0: asm(" ORI.W #0x0700,SR");
        asm(" ANDI.W #0xF0FF,SR"); 
break;

then the error is unrecognized opcode ori.w ,andi.w

can some body help me  in this regard i am quit new this field of 
embeded systems.

i think my complier is not able to undersatnd  this code.

one more in toucan1.h defined  #define CAN_IARB2 /* TouCAN Interrupt 
arbitration, 1-15 if interrups enabled */

but its used in  in toucan .c like this

/* Enable TouCAN clocks and put into debug mode. Set user defined 
bits */
CANMCR = (FRZ%2 <<14) | BIT12 | (WAKEMSK%2 <<10) | (SUPV%2 <<7) | 
(SELFWAKE%2 <<6) | (APS%2 <<5) | (CAN_IARB%8)this not declared any 
where. may be my knowledege is not reaching up to this

so i request the group help in this regard¨


regards
shanthi





-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.