I just saw your post. Being a newbie to this group, I'm not sure whether 
someone's contacted you directly, whether you've solved the problem, etc. 
Please let me know where you are on it.

I don't have my linux box with me right now. I looked at the problem briefly on 
a wonders machine and it does the same addressing.

The i = port commands don't show in the listing because 'i' isn't used; I 
suppose you know that you either have to use the result or declare such a 
variable 'volatile'.

frank

--- On Wed, 7/22/09, Rainer Haape <[email protected]> wrote:

> From: Rainer Haape <[email protected]>
> Subject: [Mspgcc-users] problem with iomacros.h
> To: [email protected]
> Date: Wednesday, July 22, 2009, 1:06 AM
> Hello,
> I have a problem with iomacros.h under linux with the
> latest Versions of 
> mspgcc.
> All ioregisters seem to be 16 Bit instead of 8 Bit, so all
> but one adresses 
> are wrong.
> The following lines in c:
> 
> #include <msp430x16x.h>
> #include <iomacros.h>
> 
> int main (void)
> {
>   char i;
>   i = port1.in.pin1;   
>     // 0x0020
>   port1.out.pin1 = 1;   
>     // 0x0021
>   port1.dir.pin1 = 1;   
>     // 0x0022
>   i = port1.ifg.pin1;   
>     // 0x0023
>   port1.ie.pin1 = 1;   
>     // 0x0025
>   port1.ies.pin1 = 1;   
>     // 0x0024
>   port1.sel.pin1 = 1;   
>     // 0x0026
> }
> 
> were compiled to:
> --- snip ---
> 
> int main (void)
> {
>     4036:    31 40 00 39
>     mov   
> #14592,    r1    ;#0x3900
>   char i;
>   i = port1.in.pin1;
>     403a:    e2 b3 20 00
>     bit.b   
> #2,    &0x0020    ;r3
> As==10
>     403e:    4f 43   
>        clr.b   
> r15        
>     4040:    4f 63   
>        adc.b   
> r15        
>   port1.out.pin1 = 1;
>     4042:    e2 d3 22 00
>     bis.b   
> #2,    &0x0022    ;r3
> As==10
>   port1.dir.pin1 = 1;
>     4046:    e2 d3 24 00
>     bis.b   
> #2,    &0x0024    ;r3
> As==10
>   i = port1.ifg.pin1;
>     404a:    e2 b3 26 00
>     bit.b   
> #2,    &0x0026    ;r3
> As==10
>     404e:    4f 43   
>        clr.b   
> r15        
>     4050:    4f 63   
>        adc.b   
> r15        
>   port1.ie.pin1 = 1;
>     4052:    e2 d3 2a 00
>     bis.b   
> #2,    &0x002a    ;r3
> As==10
>   port1.ies.pin1 = 1;
>     4056:    e2 d3 28 00
>     bis.b   
> #2,    &0x0028    ;r3
> As==10
>   port1.sel.pin1 = 1;
>     405a:    e2 d3 2c 00
>     bis.b   
> #2,    &0x002c    ;r3
> As==10
> }
> 
> --- snip ---
> 
> What is going wrong?
> 
> Thank you in advance,
> Rainer Haape
> [email protected]
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>

Reply via email to