Hi all,
I Think I have Find a Problem on the msp430gcc.
This is my source and the coresponding listing code
_________________________________________________________________________________________________________________
The Source Code.
This is an interrupt routine that manage a counter witch is tested in the
main program
__________________________________________________________________________________________________________________
#ifdef __GNUC__
interrupt (TIMERA0_VECTOR) TAINT0(void)
#else
interrupt [TIMERA0_VECTOR] void TAINT0(void)
#endif
{
_RF_EMISSION_BITS *pnt_emission;
P6OUT |= BIT7;
P6OUT &= ~BIT7;
pnt_emission = &RF_EMISSION_BITS;
// write data value
if ( pnt_emission->perm ) { // permanent emission ?
P2OUT ^= DATAMSG;
}
else {
WDTCTL = WDT_ARST_1000; //Watchdog counter = 1000ms
if ( pnt_emission->nbits ){
if ( pnt_emission->mask & *pnt_emission->value )
{
// transmit bit '1'
if ( pnt_emission->manchester-- )
// first bit
P2OUT &= ~DATAMSG; // '0'
else {// second bit
pnt_emission->manchester = 1;
P2OUT |= DATAMSG; // '1'
pnt_emission->nbits--;
( pnt_emission->mask = (pnt_emission->mask >>
1) & ~0x80); // shift + reset MSB
if ( ! --pnt_emission->nbits_byte ){
pnt_emission->nbits_byte = 8;
pnt_emission->value++;
pnt_emission->mask = 0x80;
}
}
}
else {
// transmit bit '0'
if ( pnt_emission->manchester-- )
// first bit
P2OUT |= DATAMSG; // '1'
else {// second bit
pnt_emission->manchester = 1;
P2OUT &= ~DATAMSG; // '0'
pnt_emission->nbits--; ================>>>>
look this place in the listing code
( pnt_emission->mask = (pnt_emission->mask >>
1) & ~0x80); // shift + reset MSB
if ( ! --pnt_emission->nbits_byte ){
pnt_emission->nbits_byte = 8;
pnt_emission->value++;
pnt_emission->mask = 0x80;
}
}
}
}
}
}
_________________________________________________________________________________________________________________
The listing code
This is an interrupt routine that manage a counter witch is tested in the
main program
__________________________________________________________________________________________________________________
#ifdef __GNUC__
interrupt (TIMERA0_VECTOR) TAINT0(void)
#else
interrupt [TIMERA0_VECTOR] void TAINT0(void)
#endif
{
ee7a: 0d 12 push r13 ;
ee7c: 0e 12 push r14 ;
ee7e: 0f 12 push r15 ;
_RF_EMISSION_BITS *pnt_emission;
P6OUT |= BIT7;
ee80: f2 d0 80 00 35 00 bis.b #128, &0x0035 ;#0x0080
P6OUT &= ~BIT7;
ee86: f2 f0 7f 00 35 00 and.b #127, &0x0035 ;#0x007f
pnt_emission = &RF_EMISSION_BITS;
ee8c: 3e 40 3c 02 mov #572, r14 ;#0x023c
// write data value
if ( pnt_emission->perm ) { // permanent emission ?
ee90: ce 93 00 00 cmp.b #0, 0(r14) ;subst r3 with
As==00
ee94: 04 24 jz $+10 ;abs dst addr 0xee9e
P2OUT ^= DATAMSG;
ee96: f2 e0 40 00 29 00 xor.b #64, &0x0029 ;#0x0040
ee9c: 3c 3c jmp $+122 ;abs dst addr 0xef16
}
else {
WDTCTL = WDT_ARST_1000; //Watchdog counter = 1000ms
ee9e: b2 40 0c 5a 20 01 mov #23052, &0x0120 ;#0x5a0c
if ( pnt_emission->nbits ){
eea4: 8e 93 02 00 cmp #0, 2(r14) ;subst r3 with
As==00
eea8: 36 24 jz $+110 ;abs dst addr 0xef16
if ( pnt_emission->mask & *pnt_emission->value )
{
eeaa: 1f 4e 08 00 mov 8(r14), r15 ;
eeae: 5d 4e 06 00 mov.b 6(r14), r13 ;
eeb2: 6d ff and.b @r15, r13 ;
eeb4: 4f 4d mov.b r13, r15 ;
eeb6: 4f 93 cmp.b #0, r15 ;subst r3 with
As==00
eeb8: 10 24 jz $+34 ;abs dst addr 0xeeda
// transmit bit '1'
if ( pnt_emission->manchester-- )
eeba: fe 53 05 00 add.b #-1, 5(r14) ;subst r3 with
As==11
eebe: fe 90 ff 00 05 00 cmp.b #255, 5(r14) ;#0x00ff
eec4: 04 24 jz $+10 ;abs dst addr 0xeece
// first bit
P2OUT &= ~DATAMSG; // '0'
eec6: f2 f0 bf ff 29 00 and.b #-65, &0x0029 ;#0xffbf
eecc: 24 3c jmp $+74 ;abs dst addr 0xef16
else {// second bit
pnt_emission->manchester = 1;
eece: de 43 05 00 mov.b #1, 5(r14) ;subst r3 with
As==01
P2OUT |= DATAMSG; // '1'
eed2: f2 d0 40 00 29 00 bis.b #64, &0x0029 ;#0x0040
pnt_emission->nbits--; =================================================>>
Where is the coresponding code of this line and the few next ???
( pnt_emission->mask = (pnt_emission->mask >>
1) & ~0x80); // shift + reset MSB
if ( ! --pnt_emission->nbits_byte ){
pnt_emission->nbits_byte = 8;
pnt_emission->value++;
pnt_emission->mask = 0x80;
eed8: 0f 3c jmp $+32 ;abs dst addr 0xeef8
}
}
}
else {
// transmit bit '0'
if ( pnt_emission->manchester-- )
eeda: fe 53 05 00 add.b #-1, 5(r14) ;subst r3 with
As==11
eede: fe 90 ff 00 05 00 cmp.b #255, 5(r14) ;#0x00ff
eee4: 04 24 jz $+10 ;abs dst addr 0xeeee
// first bit
P2OUT |= DATAMSG; // '1'
eee6: f2 d0 40 00 29 00 bis.b #64, &0x0029 ;#0x0040
eeec: 14 3c jmp $+42 ;abs dst addr 0xef16
else {// second bit
pnt_emission->manchester = 1;
eeee: de 43 05 00 mov.b #1, 5(r14) ;subst r3 with
As==01
P2OUT &= ~DATAMSG; // '0'
eef2: f2 f0 bf ff 29 00 and.b #-65, &0x0029 ;#0xffbf
pnt_emission->nbits--;
eef8: be 53 02 00 add #-1, 2(r14) ;subst r3 with
As==11
( pnt_emission->mask = (pnt_emission->mask >>
1) & ~0x80); // shift + reset MSB
eefc: 12 c3 clrc
eefe: 5e 10 06 00 rrc.b 6(r14) ;
if ( ! --pnt_emission->nbits_byte ){
ef02: fe 53 04 00 add.b #-1, 4(r14) ;subst r3 with
As==11
ef06: 07 20 jnz $+16 ;abs dst addr 0xef16
pnt_emission->nbits_byte = 8;
ef08: fe 42 04 00 mov.b #8, 4(r14) ;subst r2 with
As==11
pnt_emission->value++;
ef0c: 9e 53 08 00 inc 8(r14) ;
pnt_emission->mask = 0x80;
ef10: fe 40 80 00 06 00 mov.b #128, 6(r14) ;#0x0080
}
}
}
}
}
}
ef16: 3f 41 pop r15 ;
ef18: 3e 41 pop r14 ;
ef1a: 3d 41 pop r13 ;
ef1c: 00 13 reti
I have tried to modifie the source code using struct RF_EMISSION_BITS insteed
of a pointer to it but the result is the not good
Thank you for help
Bernard /_\ /_\
v
\__/
[email protected]
- [Mspgcc-users] interrupt enabling. Dmitry
- Re: [Mspgcc-users] interrupt enabling. Pedro Zorzenon Neto
- [Mspgcc-users] Code error with mps430 Bernard MONDAN
- Re: [Mspgcc-users] Code error with mps430 Dmitry
- [Mspgcc-users] Compiler Error Martin Theobald
- Re: [Mspgcc-users] Compiler Error Steve Underwood
