Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

msp430 · TI MSP430 microcontroller users group

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 7766
  • Category: Hardware
  • Founded: Oct 13, 2000
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 44263 - 44292 of 51687   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#44263 From: "bhaltulpule" <bhaltulpule@...>
Date: Sun Dec 27, 2009 3:12 am
Subject: I2C Bus non repeatable performance
bhaltulpule
Send Email Send Email
 
For my project I am using multiple MSP430F168 processors connected via a I2C bus
on USART0. The processors are isolated from each other via the ADUM1250. The SDA
and SCL lines for each proc are pulled up to +3.3V by a 1.8K resistor.  and a
RS485 serial bus on UART1. The RS485 direction is controlled by pin 3.5. My ACLK
is @ 8MHz.  The code for the device is attached.
The problem is that the I2C is very unpredictable, in that with the same code,
it runs sometimes and not othes. I have to try and recycle power sometimes or
download the same code sometimes or reset the processor thru CCE, but no clear
path  as to why this is happening and what to do about it. I cannot release this
into the end product with this flaky performance. So can you please take a look
and help me.

I have taken the code from the fet140_i2c_14.c file in the example folder on the
TI site and modified it primarily for the clock and UASRT1. At eh moment the
UART is not working either but my main concern is the I2C non repeatable
performance. Is it the pull up or something in my code ?
**code*******
//******************************************************************************
//   MSP-FET430P140 Demo - Switch Between UART0 & Master I2C Transmitter
//
//   Description: This code shows proper switching between UART and I2C
//   UART0 Puts out A-Z, CR, LF on the Hyperterminal Screen
//   and then Transmits 0x5A over I2C. This happens continuously
//   This is the I2C Master Code. For Slave, use fet140_i2c_07.c
//   ACLK = n/a, MCLK = SMCLK = I2CCLOCK = DCO ~ 800kHz
//   //* MSP430F169 Device Required *//
//
//                                 /|\  /|\
//                  MSP430F169     10k  10k     MSP430F169
//                    slave         |    |        master
//              -----------------|  |    |  -----------------
//             |             P3.1|<-|---+->|P3.1             |
//             |                 |  |      |             P3.4|--------->
//             |                 |  |      |                 |2400 - 8N1
//             |             P3.3|<-+----->|P3.3         P3.5|<---------
//             |                 |         |                 |
//
//
//
//  H. Grewal
//  Texas Instruments Inc.
//  Feb 2005
//  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
//******************************************************************************

#include  <msp430x16x.h>


void InitSerialPort(void);
void I2C_TX(void);                          // Function prototypes
void InitI2C(void);


void main(void)
{
  unsigned char i;

		 //Initialize System Clock for MCLK @ 8 MHz.
		 BCSCTL1 |= XTS; 			  			  //LFXT1CLK in high-frequency mode (8 MHz); ACLK = 8
MHz
		 BCSCTL2 |= SELM_3 + DIVM_0;  //MCLK = LFXT1CLK (8 MHz); Not Divided;
							 // SMCLK = LFXT1CLK because there is no X2 ??!!
		 //Switch MCLK from DCO to LFXT1CLK

   WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
   P1DIR |= 0x01;
   P1OUT = 0;
   P3SEL |= 0xCA;                            // UART1 and I2C pin option select
   P3DIR |= 0x40;                          // P3.6 = output direction for UART1
TXD
   P3OUT |= 0x20;                            // P3.5 = 1, for RS-485 Direction,
Always XMT.

   for (;;)
   {

   InitSerialPort();

   i = 'X';
   while (i != '\n' + 1 )
   {
     if (i==('Z'+1))
       i = '\r';
     else if (i==('\r'+1))                   // CR
       i = '\n';                             // LF

     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer ready?
     U1TXBUF = i++;                           // Output a character
     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer empty?
   }


   InitI2C();
   I2C_TX();                                 // Transmit char over I2C
   }
}

void InitSerialPort(void)
{
   I2CIE = 0x00;
   U1CTL = 0;                                // **clear U1CTL register**
   U1CTL = SWRST;                            // **Reset UART state machine**
   UCTL1 |= CHAR;                            // 8-bit character;8-N-1.
   U1TCTL |= SSEL1;                          // UCLK = ACLK
	 U1BR0  = 0x41;//9600 Baud-> 8MHz/9600 =~883 = 341h.
	 U1BR1  = 0x03;                             //BT for 9600 baud
//  UMCTL0 = 0x6B;                            // Modulation
//  UMCTL0 = 0x00;
	 ME2  |= UTXE1 + URXE1;//rx tx modules enabled...not 0
   U1CTL &= ~SWRST;                          // Initialize USART1 state machine
	 IE2  |= URXIE1 + UTXIE1;//RX interrupt (URXIFG1) enabled..not 0
}

void I2C_TX(void)
{
   while (I2CBUSY & I2CDCTL);                // I2C ready?
   I2CTCTL |= I2CSTT+I2CSTP+I2CTRX;          // Initiate transfer
   I2CDRB = 0x5A;                            // Copy data to I2CDRB
   while (I2CBUSY & I2CDCTL);                // I2C ready?
   while (I2CBB & I2CDCTL);                  // I2C ready?
   P1OUT = 0x01;
   P1OUT = 0;
}

void InitI2C(void)
{
   U0CTL |= SWRST;                           // Reset USART state machine
   U0CTL &= ~CHAR;
   U0CTL |= I2C+SYNC;                        // Recommended I2C init procedure
   U0CTL &= ~I2CEN;                          // Recommended I2C init procedure
  		 I2CSCLH = 0x07; 				 //Reduced I2C Speed
  		 I2CSCLL = 0x06;
  		 I2CPSC = 0x00;
   I2CTCTL |= I2CSSEL1;                      //Select ACLK = LFXT1CLK
   I2CSA = 0x0048;                           // Address of Slave
   U0CTL |= MST;                             // Master mode
   I2CNDAT = 0x01;                           // Write one byte
   U0CTL |= I2CEN;                           // Enable I2C
}

#44264 From: "Martin Bruner" <Marty@...>
Date: Sat Dec 26, 2009 9:14 pm
Subject: Re: hi. I have a problem
martymoose63
Send Email Send Email
 
I think he should drop the class.



[Non-text portions of this message have been removed]

#44265 From: "Martin Bruner" <Marty@...>
Date: Sat Dec 26, 2009 11:12 pm
Subject: Re: hi. I have a problem
martymoose63
Send Email Send Email
 
My advice..  Change your major to Business!



[Non-text portions of this message have been removed]

#44266 From: "requirehelpmsp430" <requirehelpmsp430@...>
Date: Mon Dec 28, 2009 6:34 am
Subject: msp430 help
requirehelpm...
Send Email Send Email
 
Hello everyone,

I am currently pursuing my Masters in Electronics,in India. I am working on a
project on MSP430, which controls number of applications . All the hardware and
codes are ready for the project. However, the project is not working and I am
unable to debug the problem.  I am currently unable to dedicate much time to
project due to my personal life problems.

I would like to have professional help from anyone, to make my project working.
I am willing to provide the consultation charges to him for the same. Please
provide me the prompt reply ,so that I will be in touch with him with my project
details.Please reply me as I am running out of time..

#44267 From: "Leon Heller" <leon355@...>
Date: Mon Dec 28, 2009 12:22 pm
Subject: Re: msp430 help
leon_heller
Send Email Send Email
 
----- Original Message -----
From: "requirehelpmsp430" <requirehelpmsp430@...>
To: <msp430@yahoogroups.com>
Sent: Monday, December 28, 2009 6:34 AM
Subject: [msp430] msp430 help


> Hello everyone,
>
> I am currently pursuing my Masters in Electronics,in India. I am working
> on a project on MSP430, which controls number of applications . All the
> hardware and codes are ready for the project. However, the project is not
> working and I am unable to debug the problem.  I am currently unable to
> dedicate much time to project due to my personal life problems.
>
> I would like to have professional help from anyone, to make my project
> working. I am willing to provide the consultation charges to him for the
> same. Please provide me the prompt reply ,so that I will be in touch with
> him with my project details.Please reply me as I am running out of time..

You are a very naughty boy!

Leon

#44268 From: "Hayashi, Steve" <shayashi@...>
Date: Mon Dec 28, 2009 2:11 pm
Subject: RE: msp430 help
herlhayashi
Send Email Send Email
 
In the US, there is, or was, a trend to outsource jobs to India.

Is this a case of someone trying to outsource a job to the US?

-Steve

From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com] On Behalf Of Leon
Heller
Sent: Monday, December 28, 2009 7:22 AM
To: msp430@yahoogroups.com
Subject: Re: [msp430] msp430 help



----- Original Message -----
From: "requirehelpmsp430"
<requirehelpmsp430@...<mailto:requirehelpmsp430%40yahoo.in>>
To: <msp430@yahoogroups.com<mailto:msp430%40yahoogroups.com>>
Sent: Monday, December 28, 2009 6:34 AM
Subject: [msp430] msp430 help

> Hello everyone,
>
> I am currently pursuing my Masters in Electronics,in India. I am working
> on a project on MSP430, which controls number of applications . All the
> hardware and codes are ready for the project. However, the project is not
> working and I am unable to debug the problem. I am currently unable to
> dedicate much time to project due to my personal life problems.
>
> I would like to have professional help from anyone, to make my project
> working. I am willing to provide the consultation charges to him for the
> same. Please provide me the prompt reply ,so that I will be in touch with
> him with my project details.Please reply me as I am running out of time..

You are a very naughty boy!

Leon



[Non-text portions of this message have been removed]

#44269 From: "old_cow_yellow" <old_cow_yellow@...>
Date: Mon Dec 28, 2009 2:44 pm
Subject: Re: msp430 help
old_cow_yellow
Send Email Send Email
 
In US, there are a lot of establishments where you can get a degree or something
like that by simply paying them the "tuition". No homework or exams are
required. Attendance is not even an option.

I guess there are no such things in India. Am I wrong?

--- In msp430@yahoogroups.com, "Hayashi, Steve" <shayashi@...> wrote:
>
> In the US, there is, or was, a trend to outsource jobs to India.
>
> Is this a case of someone trying to outsource a job to the US?
>
> -Steve
>
> From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com] On Behalf Of Leon
Heller
> Sent: Monday, December 28, 2009 7:22 AM
> To: msp430@yahoogroups.com
> Subject: Re: [msp430] msp430 help
>
>
>
> ----- Original Message -----
> From: "requirehelpmsp430"
<requirehelpmsp430@...<mailto:requirehelpmsp430%40yahoo.in>>
> To: <msp430@yahoogroups.com<mailto:msp430%40yahoogroups.com>>
> Sent: Monday, December 28, 2009 6:34 AM
> Subject: [msp430] msp430 help
>
> > Hello everyone,
> >
> > I am currently pursuing my Masters in Electronics,in India. I am working
> > on a project on MSP430, which controls number of applications . All the
> > hardware and codes are ready for the project. However, the project is not
> > working and I am unable to debug the problem. I am currently unable to
> > dedicate much time to project due to my personal life problems.
> >
> > I would like to have professional help from anyone, to make my project
> > working. I am willing to provide the consultation charges to him for the
> > same. Please provide me the prompt reply ,so that I will be in touch with
> > him with my project details.Please reply me as I am running out of time..
>
> You are a very naughty boy!
>
> Leon
>
>
>
> [Non-text portions of this message have been removed]
>

#44270 From: "requirehelpmsp430" <requirehelpmsp430@...>
Date: Mon Dec 28, 2009 2:37 pm
Subject: Re: msp430 help
requirehelpm...
Send Email Send Email
 
No offence taken, bro .. But I am going through a very bad patch of my life,
where the balance is very important between personal life and professional life
( like tiger woods, may be, but personal reasons are entirely different)..That's
why I am looking 4 help in such a big world..I hope I can find any one.....
--- In msp430@yahoogroups.com, "Leon Heller" <leon355@...> wrote:
>
> ----- Original Message -----
> From: "requirehelpmsp430" <requirehelpmsp430@...>
> To: <msp430@yahoogroups.com>
> Sent: Monday, December 28, 2009 6:34 AM
> Subject: [msp430] msp430 help
>
>
> > Hello everyone,
> >
> > I am currently pursuing my Masters in Electronics,in India. I am working
> > on a project on MSP430, which controls number of applications . All the
> > hardware and codes are ready for the project. However, the project is not
> > working and I am unable to debug the problem.  I am currently unable to
> > dedicate much time to project due to my personal life problems.
> >
> > I would like to have professional help from anyone, to make my project
> > working. I am willing to provide the consultation charges to him for the
> > same. Please provide me the prompt reply ,so that I will be in touch with
> > him with my project details.Please reply me as I am running out of time..
>
> You are a very naughty boy!
>
> Leon
>

#44271 From: "Martin Bruner" <Marty@...>
Date: Mon Dec 28, 2009 3:09 pm
Subject: Re: msp430 help
martymoose63
Send Email Send Email
 
Hey Bro,



We all have personal problems.  Maybe you should just drop the class.



[Non-text portions of this message have been removed]

#44272 From: "mmarks2001" <mmarks@...>
Date: Mon Dec 28, 2009 3:22 pm
Subject: Re: MSP430FG437 Info Segment Erase Troubles
mmarks2001
Send Email Send Email
 
It looks like our segment erase problem may be solved.  We recently got some new
boards in, and the code I posted earlier works fine and erases both Info
segments with no problems.

Apparently, early product code we were running on our two engineering build
units ended up creating tens of thousands of internal errors, each of which gets
logged into the Info segment that was not being erased correctly when I first
posted my question to the forum.  Each error logged causes the segment to be
erased and rewritten, so apparently we used up the number of erase/write cycles
for that segment of flash.  Based on some of the error counts I saw when digging
it, it is certainly feasible given a flash life of 100,000 cycles.

Thanks to those who took the time to reply and look over our code, and hopefully
other can benefit from my experience with using up the flash cycles.
--
Mike Marks



--- In msp430@yahoogroups.com, "Michael" <mkusch@...> wrote:

>
> --- In msp430@yahoogroups.com, "mmarks2001" <mmarks@> wrote:
> >
> > I am having an unusual problem with erasing the INFO segments of an
MSP430FG437.  The problem occurs when using our own routine to erase INFO
Segment B from 0x1000 to 0x107F.  The same routine correctly erases INFO Segment
A (0x1080 to 0x10FF) just fine, but when I call the same routine for Info
Segment B, I can see that the segment is not correctly erased and is filled with
garbage.
> >
> > When I use the IAR to download code and choose the "Erase Main and
Information Memory" option, both info segments are correctly erased as I would
expect.
> >
> > Our routine for erasing is flash_erase_segment() which I included at the
bottom.
> >
> > Any insights you could give would be helpful; I couldn't find anything
special in the datasheet that we had to do for Segment B compared to the other
flash segments.  I am using the IAR Embedded Workbench version 4.21.2
(4.21.2.50066).
> >
> > For now I have a workaround of simply saving everything we need to into
segment that works, but I would like to better understand why our routine can
erase Info A, but not Info B.
> >
> > Here's the main routine of some test code:
> >
> > void main(void)
> > {
> >     WDTCTL = WDTPW | WDTHOLD;    // Disable watchdog
> >
> >     // Testing Flash Erase stuff
> >     // Fix both info segments with zeroes
> >     int i;
> >     unsigned char *destAddr;
> >     destAddr = (unsigned char *) 0x1000;
> >
> >     for (i = 0; i < 256; i++)   // Stuff INFO segments with zeros
> >     {
> >         flash_write_byte(0, destAddr++);
> >     }
> >
> >     flash_erase_segment((unsigned char *) 0x1080);
> >     flash_erase_segment((unsigned char *) 0x1000);
> >
> >     while(1);
> > }
> >
> > void flash_erase_segment(unsigned char *seg_addr)
> > {
> >    unsigned int wd_reg;
> >
> >    /* Store watchdog timer register */
> >    wd_reg = WDTCTL;
> >
> >    /* Put the watchdog timer on hold */
> >    WDTCTL = WDTPW | WDTHOLD;
> >
> >    /* Disable interrupts */
> >    _DINT();
> >
> >    /* Flash clock Fftg must be: 257 KHz < Fftg < 476 KHz  */
> >    /* Set the flash clock to SMCLK / 3. */
> >    FCTL2 = FWKEY | FSSEL_2 | 0x02;
> >
> >    /* Disable flash lock */
> >    FCTL3 = FWKEY;
> >
> >    /* Enable Erases */
> >    FCTL1 = FWKEY | ERASE;
> >
> >    /* Dummy write into segment */
> >    *seg_addr = 0x00;
> >
> >    /* Lock the flash */
> >    FCTL3 = FWKEY | LOCK;
> >
> >    /* Disable Erases */
> >    FCTL1 = FWKEY;
> >
> >    /* Re-enable interrupts and watchdog */
> >    _EINT();
> >    WDTCTL = WDTPW | (0x00FF & wd_reg);
> > }
> >
> >
> > Thanks,
> >
> >
> > Mike
> >
>

#44273 From: "old_cow_yellow" <old_cow_yellow@...>
Date: Mon Dec 28, 2009 3:45 pm
Subject: Re: MSP430FG437 Info Segment Erase Troubles
old_cow_yellow
Send Email Send Email
 
Thanks for the info.

--- In msp430@yahoogroups.com, "mmarks2001" <mmarks@...> wrote:
>
>
> It looks like our segment erase problem may be solved.  We recently got some
new boards in, and the code I posted earlier works fine and erases both Info
segments with no problems.
>
> Apparently, early product code we were running on our two engineering build
units ended up creating tens of thousands of internal errors, each of which gets
logged into the Info segment that was not being erased correctly when I first
posted my question to the forum.  Each error logged causes the segment to be
erased and rewritten, so apparently we used up the number of erase/write cycles
for that segment of flash.  Based on some of the error counts I saw when digging
it, it is certainly feasible given a flash life of 100,000 cycles.
>
> Thanks to those who took the time to reply and look over our code, and
hopefully other can benefit from my experience with using up the flash cycles.
> --
> Mike Marks
>
>
>
> --- In msp430@yahoogroups.com, "Michael" <mkusch@> wrote:
>
> >
> > --- In msp430@yahoogroups.com, "mmarks2001" <mmarks@> wrote:
> > >
> > > I am having an unusual problem with erasing the INFO segments of an
MSP430FG437.  The problem occurs when using our own routine to erase INFO
Segment B from 0x1000 to 0x107F.  The same routine correctly erases INFO Segment
A (0x1080 to 0x10FF) just fine, but when I call the same routine for Info
Segment B, I can see that the segment is not correctly erased and is filled with
garbage.
> > >
> > > When I use the IAR to download code and choose the "Erase Main and
Information Memory" option, both info segments are correctly erased as I would
expect.
> > >
> > > Our routine for erasing is flash_erase_segment() which I included at the
bottom.
> > >
> > > Any insights you could give would be helpful; I couldn't find anything
special in the datasheet that we had to do for Segment B compared to the other
flash segments.  I am using the IAR Embedded Workbench version 4.21.2
(4.21.2.50066).
> > >
> > > For now I have a workaround of simply saving everything we need to into
segment that works, but I would like to better understand why our routine can
erase Info A, but not Info B.
> > >
> > > Here's the main routine of some test code:
> > >
> > > void main(void)
> > > {
> > >     WDTCTL = WDTPW | WDTHOLD;    // Disable watchdog
> > >
> > >     // Testing Flash Erase stuff
> > >     // Fix both info segments with zeroes
> > >     int i;
> > >     unsigned char *destAddr;
> > >     destAddr = (unsigned char *) 0x1000;
> > >
> > >     for (i = 0; i < 256; i++)   // Stuff INFO segments with zeros
> > >     {
> > >         flash_write_byte(0, destAddr++);
> > >     }
> > >
> > >     flash_erase_segment((unsigned char *) 0x1080);
> > >     flash_erase_segment((unsigned char *) 0x1000);
> > >
> > >     while(1);
> > > }
> > >
> > > void flash_erase_segment(unsigned char *seg_addr)
> > > {
> > >    unsigned int wd_reg;
> > >
> > >    /* Store watchdog timer register */
> > >    wd_reg = WDTCTL;
> > >
> > >    /* Put the watchdog timer on hold */
> > >    WDTCTL = WDTPW | WDTHOLD;
> > >
> > >    /* Disable interrupts */
> > >    _DINT();
> > >
> > >    /* Flash clock Fftg must be: 257 KHz < Fftg < 476 KHz  */
> > >    /* Set the flash clock to SMCLK / 3. */
> > >    FCTL2 = FWKEY | FSSEL_2 | 0x02;
> > >
> > >    /* Disable flash lock */
> > >    FCTL3 = FWKEY;
> > >
> > >    /* Enable Erases */
> > >    FCTL1 = FWKEY | ERASE;
> > >
> > >    /* Dummy write into segment */
> > >    *seg_addr = 0x00;
> > >
> > >    /* Lock the flash */
> > >    FCTL3 = FWKEY | LOCK;
> > >
> > >    /* Disable Erases */
> > >    FCTL1 = FWKEY;
> > >
> > >    /* Re-enable interrupts and watchdog */
> > >    _EINT();
> > >    WDTCTL = WDTPW | (0x00FF & wd_reg);
> > > }
> > >
> > >
> > > Thanks,
> > >
> > >
> > > Mike
> > >
> >
>

#44274 From: "Redd, Emmett R" <EmmettRedd@...>
Date: Mon Dec 28, 2009 6:02 pm
Subject: RE: Re: msp430 help
emmettredd
Send Email Send Email
 
I often have to consult students who are failing their way out of the
university.  Many times I have to give the following advice:

Work, School, Family/Personal Life.  Choose any two.

Emmett Redd Ph.D.   mailto:EmmettRedd@...
Professor                                 (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University             Fax (417)836-6226
901 SOUTH NATIONAL                   Dept (417)836-5131
SPRINGFIELD, MO  65897   USA

"In theory there is no difference between theory and practice. In practice there
is." -- Yogi Berra or Jan van de Snepscheut


> -----Original Message-----
> From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com]
> On Behalf Of Martin Bruner
> Sent: Monday, December 28, 2009 9:09 AM
> To: msp430@yahoogroups.com
> Subject: [msp430] Re: msp430 help
>
> Hey Bro,
>
>
>
> We all have personal problems.  Maybe you should just drop
> the class.
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> To unsubscribe from the msp430 group, send an email to:
> msp430-unsubscribe@egroups.com
>
> Yahoo! Groups Links
>
>
>
>

#44275 From: Philip Freidin <philip@...>
Date: Tue Dec 29, 2009 12:45 am
Subject: Re: hi. I have a problem
fliptronics
Send Email Send Email
 
The following is a modified version of a posting by Bob Perlman to
comp.arch.fpga  ,  circa 12/2003.   It seems appropriate.

    =============

Post to msp430@yahoogroups.com, December  26, 2009
-----
>    Subject:    hi. I have a problem
>    Posted by: "nazim corakli" baynazim@... baynazim
>    Date: Sat Dec 26, 2009 12:20 pm ((PST))
>
>I am new on this group. I have an exam with msp430. I will post it on group
>but it is immediate stuation. I have to finish this homework in 2 days. we
>have a msp430 and several leds on portb. this is my homework:
>1- I must give an analog signal to adc and convert it from analog to digital
>2- I must write this in ram with use dma
>3- I must read data in ram and show this on leds 
> 
>(this ports donT matter. choose ones which you want . I can fix it to myself
later)
> 
>pls help me. it is immediate. thanks



Why stop at asking for help with homework problems?  I can imagine the
series of posts we'll see in years to come.


Post to msp430@yahoogroups.com, April 7, 2011
------
Suppose you were a newly-minted PhD who was hired to develop a
revolutionary low power MCU architecture.  What would that architecture be?
And don't just wave your arms; I'd like to see a spec.  With lots and
lots of pictures.


Post to sci.electronics, November 1, 2014
-----
I know that this seems pretty hypothetical, but imagine you were
promoted to head of product development at a big IC company, based on
your success in developing a revolutionary low power MCU architecture,
some of which--OK, maybe all of which--you happened to find on Usenet
(thanks, old_cow_yellow!).  What would you do now?  Specifically, what
kinds of new devices would you develop?  And do you happen to have
detailed data sheets for those devices?


Post to alt.help.legal, July 2, 2020
-----
What would you do if you, the CEO of a Fortune 500 company, suddenly
found yourself the subject of an investigation by the US Attorney
General, who claims that every idea your company profited from was
stolen?  (Personally, I prefer the term "redeployed" to "stolen," but
the Attorney General refuses to budge on this.  Whoever thought that
Jenna Bush would be such a stickler for the law?)  Is this a
leave-the-country kind of thing, or do you think a person could get
the kind of deal that those Enron guys got?  Just wondering.


Happy new year,
Philip



=================
Philip Freidin
philip@...

#44276 From: joshua digginapalli <prakash03432@...>
Date: Tue Dec 29, 2009 5:19 am
Subject: Pulse Width Problem...
prakash_03432
Send Email Send Email
 
Hi frnds,

                    My Belated wishes on  christmas & Happy New Year in
advance. Hope you all enjoyed christmas well through God's grace.
              Then Here Comes my problem , im working on MP430F169
controller.Im my application i want to generate pulses from two DAC's i.e.,
DAC0 & DAC1 .So far i have done this with 70microseconds positive pulse
width and voltage upto 3V. I Applied this signal to an Op-amp TLV2244 which
works on 12V power Supply.THis Op-amp buffers the appld signal if It's input
signal's pulse width is 30milliseconds , but where as my requirement is
to amplify this 3V signal to 10.5V with pulse width of 70microseconds. If im
giving signal below 30ms , i cant able to observe the signal also. So,can
some body suggest me the Op-amp or how to proceed further , to complete my
requirement.

Joshua.


[Non-text portions of this message have been removed]

#44277 From: Richard Man <richard-lists@...>
Date: Tue Dec 29, 2009 5:47 am
Subject: Re: hi. I have a problem
richard-lists@...
Send Email Send Email
 
Mustn't be in the Silicon Valley, otherwise the dates would be 2011,
2012, and 2013. You know, Internet time...


At 04:45 PM 12/28/2009, Philip Freidin wrote:

>The following is a modified version of a posting by Bob Perlman to
>comp.arch.fpga  ,  circa 12/2003.   It seems appropriate.
>

// richard <http://www.imagecraft.com>
// http://rfman.wordpress.com
// http://www.imagecraft.com/pub/Portfolio09/

#44278 From: "Jitendra Chauhan - ERS, HCL Tech" <jitendra.c@...>
Date: Tue Dec 29, 2009 11:25 am
Subject: RE: Re: msp430 help
chauhan_jite...
Send Email Send Email
 
Leon,

Contact me on Jitendra.c@...<mailto:Jitendra.c@...>

Regards,
Jitendra

From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com] On Behalf Of Martin
Bruner
Sent: Monday, December 28, 2009 8:39 PM
To: msp430@yahoogroups.com
Subject: [msp430] Re: msp430 help



Hey Bro,

We all have personal problems. Maybe you should just drop the class.

[Non-text portions of this message have been removed]


DISCLAIMER:
--------------------------------------------------------------------------------\
---------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates.
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is
strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately.
Before opening any mail and
attachments please check them for viruses and defect.

--------------------------------------------------------------------------------\
---------------------------------------


[Non-text portions of this message have been removed]

#44279 From: "Michael" <mkusch@...>
Date: Wed Dec 30, 2009 8:39 pm
Subject: Re: I2C Bus non repeatable performance
tintronic
Send Email Send Email
 
One question: are there multiple I2C masters in your configuration or just one?
You say multiple processors, so I guess you mean more than just 2. If there are
many masters, how are you handling collisions?

In any case, get a digital analyser and scope/decode the I2C bus. You can get
one for 149 US dollars and it will greatly improve your troubleshooting
productivity.

The rest of your setup I don't understand. If you are having problems with I2C,
what has RS485 to do with anything?

Take a step back, look at your problem, and write it again so ANYONE might
understand your setup.

Regards,
Michael K.



--- In msp430@yahoogroups.com, "bhaltulpule" <bhaltulpule@...> wrote:
>
> For my project I am using multiple MSP430F168 processors connected via a I2C
bus on USART0. The processors are isolated from each other via the ADUM1250. The
SDA and SCL lines for each proc are pulled up to +3.3V by a 1.8K resistor.  and
a RS485 serial bus on UART1. The RS485 direction is controlled by pin 3.5. My
ACLK is @ 8MHz.  The code for the device is attached.
> The problem is that the I2C is very unpredictable, in that with the same code,
it runs sometimes and not othes. I have to try and recycle power sometimes or
download the same code sometimes or reset the processor thru CCE, but no clear
path  as to why this is happening and what to do about it. I cannot release this
into the end product with this flaky performance. So can you please take a look
and help me.
>
> I have taken the code from the fet140_i2c_14.c file in the example folder on
the TI site and modified it primarily for the clock and UASRT1. At eh moment the
UART is not working either but my main concern is the I2C non repeatable
performance. Is it the pull up or something in my code ?
> **code*******
>
//******************************************************************************
> //   MSP-FET430P140 Demo - Switch Between UART0 & Master I2C Transmitter
> //
> //   Description: This code shows proper switching between UART and I2C
> //   UART0 Puts out A-Z, CR, LF on the Hyperterminal Screen
> //   and then Transmits 0x5A over I2C. This happens continuously
> //   This is the I2C Master Code. For Slave, use fet140_i2c_07.c
> //   ACLK = n/a, MCLK = SMCLK = I2CCLOCK = DCO ~ 800kHz
> //   //* MSP430F169 Device Required *//
> //
> //                                 /|\  /|\
> //                  MSP430F169     10k  10k     MSP430F169
> //                    slave         |    |        master
> //              -----------------|  |    |  -----------------
> //             |             P3.1|<-|---+->|P3.1             |
> //             |                 |  |      |             P3.4|--------->
> //             |                 |  |      |                 |2400 - 8N1
> //             |             P3.3|<-+----->|P3.3         P3.5|<---------
> //             |                 |         |                 |
> //
> //
> //
> //  H. Grewal
> //  Texas Instruments Inc.
> //  Feb 2005
> //  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
>
//******************************************************************************
>
> #include  <msp430x16x.h>
>
>
> void InitSerialPort(void);
> void I2C_TX(void);                          // Function prototypes
> void InitI2C(void);
>
>
> void main(void)
> {
>  unsigned char i;
>
> 	 //Initialize System Clock for MCLK @ 8 MHz.
> 	 BCSCTL1 |= XTS; 			  			  //LFXT1CLK in high-frequency mode (8 MHz); ACLK =
8 MHz
> 	 BCSCTL2 |= SELM_3 + DIVM_0;  //MCLK = LFXT1CLK (8 MHz); Not Divided;
> 						 // SMCLK = LFXT1CLK because there is no X2 ??!!
> 	 //Switch MCLK from DCO to LFXT1CLK
>
>   WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
>   P1DIR |= 0x01;
>   P1OUT = 0;
>   P3SEL |= 0xCA;                            // UART1 and I2C pin option select
>   P3DIR |= 0x40;                          // P3.6 = output direction for UART1
TXD
>   P3OUT |= 0x20;                            // P3.5 = 1, for RS-485 Direction,
Always XMT.
>
>   for (;;)
>   {
>
>   InitSerialPort();
>
>   i = 'X';
>   while (i != '\n' + 1 )
>   {
>     if (i==('Z'+1))
>       i = '\r';
>     else if (i==('\r'+1))                   // CR
>       i = '\n';                             // LF
>
>     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer ready?
>     U1TXBUF = i++;                           // Output a character
>     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer empty?
>   }
>
>
>   InitI2C();
>   I2C_TX();                                 // Transmit char over I2C
>   }
> }
>
> void InitSerialPort(void)
> {
>   I2CIE = 0x00;
>   U1CTL = 0;                                // **clear U1CTL register**
>   U1CTL = SWRST;                            // **Reset UART state machine**
>   UCTL1 |= CHAR;                            // 8-bit character;8-N-1.
>   U1TCTL |= SSEL1;                          // UCLK = ACLK
>  U1BR0  = 0x41;//9600 Baud-> 8MHz/9600 =~883 = 341h.
>  U1BR1  = 0x03;                             //BT for 9600 baud
> //  UMCTL0 = 0x6B;                            // Modulation
> //  UMCTL0 = 0x00;
>  ME2  |= UTXE1 + URXE1;//rx tx modules enabled...not 0
>   U1CTL &= ~SWRST;                          // Initialize USART1 state machine
>  IE2  |= URXIE1 + UTXIE1;//RX interrupt (URXIFG1) enabled..not 0
> }
>
> void I2C_TX(void)
> {
>   while (I2CBUSY & I2CDCTL);                // I2C ready?
>   I2CTCTL |= I2CSTT+I2CSTP+I2CTRX;          // Initiate transfer
>   I2CDRB = 0x5A;                            // Copy data to I2CDRB
>   while (I2CBUSY & I2CDCTL);                // I2C ready?
>   while (I2CBB & I2CDCTL);                  // I2C ready?
>   P1OUT = 0x01;
>   P1OUT = 0;
> }
>
> void InitI2C(void)
> {
>   U0CTL |= SWRST;                           // Reset USART state machine
>   U0CTL &= ~CHAR;
>   U0CTL |= I2C+SYNC;                        // Recommended I2C init procedure
>   U0CTL &= ~I2CEN;                          // Recommended I2C init procedure
>   	 I2CSCLH = 0x07; 				 //Reduced I2C Speed
>   	 I2CSCLL = 0x06;
>   	 I2CPSC = 0x00;
>   I2CTCTL |= I2CSSEL1;                      //Select ACLK = LFXT1CLK
>   I2CSA = 0x0048;                           // Address of Slave
>   U0CTL |= MST;                             // Master mode
>   I2CNDAT = 0x01;                           // Write one byte
>   U0CTL |= I2CEN;                           // Enable I2C
> }
>

#44280 From: "Michael" <mkusch@...>
Date: Wed Dec 30, 2009 8:48 pm
Subject: Re: msp430 help
tintronic
Send Email Send Email
 
Great advice indeed, Emmett.
Thanks for sharing it.

Michael K.

--- In msp430@yahoogroups.com, "Redd, Emmett R" <EmmettRedd@...> wrote:
>
> I often have to consult students who are failing their way out of the
university.  Many times I have to give the following advice:
>
> Work, School, Family/Personal Life.  Choose any two.
>
> Emmett Redd Ph.D.   mailto:EmmettRedd@...
> Professor                                 (417)836-5221
> Department of Physics, Astronomy, and Materials Science
> Missouri State University             Fax (417)836-6226
> 901 SOUTH NATIONAL                   Dept (417)836-5131
> SPRINGFIELD, MO  65897   USA
>
> "In theory there is no difference between theory and practice. In practice
there is." -- Yogi Berra or Jan van de Snepscheut
>
>
> > -----Original Message-----
> > From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com]
> > On Behalf Of Martin Bruner
> > Sent: Monday, December 28, 2009 9:09 AM
> > To: msp430@yahoogroups.com
> > Subject: [msp430] Re: msp430 help
> >
> > Hey Bro,
> >
> >
> >
> > We all have personal problems.  Maybe you should just drop
> > the class.
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > To unsubscribe from the msp430 group, send an email to:
> > msp430-unsubscribe@egroups.com
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>

#44281 From: "Michael" <mkusch@...>
Date: Wed Dec 30, 2009 9:09 pm
Subject: Re: Pulse Width Problem...
tintronic
Send Email Send Email
 
Joshua,
I don't understand your setup. Can you ellaborate a little more?
If you want to generate *pulses*, why use the DACs? Are they amplitude varying
pulses?

But what did you expect form the OA? If I resume what you wrote to:
1)You generate 70us
2)The amplifier works with 30ms
3)You need 70us
4)You don't see anything with <30ms.

3) is incompatible with 2), so here is no use in 1), because you will obviously
get 4). You need a faster OA, then look for a faster OA.
Or Maybe a different approach altogether. Forget what you WANT and focus on what
you NEED.

Why not just use any of the Timer Capture/Compare(PWM) modules? You can use one
DAC + amplifier to generate the target voltage, and level-shifting logic to
connect the TAx/TBx output to the generated voltage and in this way generate the
pulses.

Regards,
Michael K.

--- In msp430@yahoogroups.com, joshua digginapalli <prakash03432@...> wrote:
>
>   Hi frnds,
>
>                    My Belated wishes on  christmas & Happy New Year in
> advance. Hope you all enjoyed christmas well through God's grace.
>              Then Here Comes my problem , im working on MP430F169
> controller.Im my application i want to generate pulses from two DAC's i.e.,
> DAC0 & DAC1 .So far i have done this with 70microseconds positive pulse
> width and voltage upto 3V. I Applied this signal to an Op-amp TLV2244 which
> works on 12V power Supply.THis Op-amp buffers the appld signal if It's input
> signal's pulse width is 30milliseconds , but where as my requirement is
> to amplify this 3V signal to 10.5V with pulse width of 70microseconds. If im
> giving signal below 30ms , i cant able to observe the signal also. So,can
> some body suggest me the Op-amp or how to proceed further , to complete my
> requirement.
>
> Joshua.
>
>
> [Non-text portions of this message have been removed]
>

#44282 From: "Toh Hui Choo" <hctoh@...>
Date: Thu Dec 31, 2009 2:16 am
Subject: ADC12 interrupt vector
hctoh@...
Send Email Send Email
 
Hi,



I am having some problems understanding and need some help with the ADC12
interrupt vector. My requirements are:



1)       A sequence of channels sampled and converted continuously,
(CONSEQ_3)

2)       Converted results are stored in variable, A0results, A1results,
A2results and A3results

3)       For averaging purposes, the data are captured 4 times continuously
and stored in to results.

4)       Process data

5)       Repeat step (1) again.



The code is taken from the demo program.



#include

#define Num_of_Results 4

static unsigned int A0results[Num_of_Results]; // These need to be global in

static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
the

static unsigned int A2results[Num_of_Results]; // compiler removes them
because

static unsigned int A3results[Num_of_Results]; // they are not used

void main(void)

{

WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer

P6SEL = 0x0F; // Enable A/D channel inputs

ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time

// to avoid overflow of results

ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence

ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0

ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1

ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2

ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.

ADC12IE = 0x08; // Enable ADC12IFG.3

ADC12CTL0 |= ENC; // Enable conversions

ADC12CTL0 |= ADC12SC; // Start conversion

_BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts

}

#pragma vector=ADC12_VECTOR

__interrupt void ADC12ISR (void)

{

static unsigned int index = 0;

A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared

A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared

A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared

A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared

index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
Breakpoint

here

}



Once it goes into LPM0 and enter the interrupt vector, it loops within
endlessly.

Can someone please advice on how can I exit from the interrupt vector after
capturing the results?



Thank you.



Best regards,

Hui Choo





[Non-text portions of this message have been removed]

#44283 From: "old_cow_yellow" <old_cow_yellow@...>
Date: Thu Dec 31, 2009 6:47 am
Subject: Re: ADC12 interrupt vector
old_cow_yellow
Send Email Send Email
 
You said: "The code is taken from the demo program."

What is THE demo program?
What does that demo program demonstrate?
Why do you use the code of that demo program?

--- In msp430@yahoogroups.com, "Toh Hui Choo" <hctoh@...> wrote:
>
> Hi,
>
>
>
> I am having some problems understanding and need some help with the ADC12
> interrupt vector. My requirements are:
>
>
>
> 1)       A sequence of channels sampled and converted continuously,
> (CONSEQ_3)
>
> 2)       Converted results are stored in variable, A0results, A1results,
> A2results and A3results
>
> 3)       For averaging purposes, the data are captured 4 times continuously
> and stored in to results.
>
> 4)       Process data
>
> 5)       Repeat step (1) again.
>
>
>
> The code is taken from the demo program.
>
>
>
> #include
>
> #define Num_of_Results 4
>
> static unsigned int A0results[Num_of_Results]; // These need to be global in
>
> static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
> the
>
> static unsigned int A2results[Num_of_Results]; // compiler removes them
> because
>
> static unsigned int A3results[Num_of_Results]; // they are not used
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
>
> P6SEL = 0x0F; // Enable A/D channel inputs
>
> ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
>
> // to avoid overflow of results
>
> ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
>
> ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0
>
> ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
>
> ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2
>
> ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.
>
> ADC12IE = 0x08; // Enable ADC12IFG.3
>
> ADC12CTL0 |= ENC; // Enable conversions
>
> ADC12CTL0 |= ADC12SC; // Start conversion
>
> _BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts
>
> }
>
> #pragma vector=ADC12_VECTOR
>
> __interrupt void ADC12ISR (void)
>
> {
>
> static unsigned int index = 0;
>
> A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared
>
> A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared
>
> A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared
>
> A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared
>
> index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
> Breakpoint
>
> here
>
> }
>
>
>
> Once it goes into LPM0 and enter the interrupt vector, it loops within
> endlessly.
>
> Can someone please advice on how can I exit from the interrupt vector after
> capturing the results?
>
>
>
> Thank you.
>
>
>
> Best regards,
>
> Hui Choo
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

#44284 From: "p_murayama" <pascal@...>
Date: Thu Dec 31, 2009 7:03 am
Subject: Re: ADC12 interrupt vector
p_murayama
Send Email Send Email
 
Hello!

If you don't want to reply his questions, why do you bother posting?

Now to the original poster:
I think I know what happens. You have compiled THE sample code, and you
have set a breakpoint where the source tells you, at the last line of the
interrupt service routine, right?
Now what happens is that when you set a breakpoint, it stops the program
where you tell it to. But as you ask for continuous sampling, immediately
after you stopped, you have already another interrupt coming. Therefore,
if you try to do a single step forwards, then you land again at the beginning
of the interrupt routine.

If you want to do steo by step within your ADC routine, then you have to
disable interrupts first.
Try this:
__interrupt void ADC12ISR (void)  {
     __DINT(); // Disable interrupts
< same code as previously here >
     __EINT(); // Enable interrupts
}

Then you will be able to step into your code.

Pascal

--- In msp430@yahoogroups.com, "old_cow_yellow" <old_cow_yellow@...> wrote:
>
> You said: "The code is taken from the demo program."
>
> What is THE demo program?
> What does that demo program demonstrate?
> Why do you use the code of that demo program?
>
> --- In msp430@yahoogroups.com, "Toh Hui Choo" <hctoh@> wrote:
> >
> > Hi,
> >
> >
> >
> > I am having some problems understanding and need some help with the ADC12
> > interrupt vector. My requirements are:
> >
> >
> >
> > 1)       A sequence of channels sampled and converted continuously,
> > (CONSEQ_3)
> >
> > 2)       Converted results are stored in variable, A0results, A1results,
> > A2results and A3results
> >
> > 3)       For averaging purposes, the data are captured 4 times continuously
> > and stored in to results.
> >
> > 4)       Process data
> >
> > 5)       Repeat step (1) again.
> >
> >
> >
> > The code is taken from the demo program.
> >
> >
> >
> > #include
> >
> > #define Num_of_Results 4
> >
> > static unsigned int A0results[Num_of_Results]; // These need to be global in
> >
> > static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
> > the
> >
> > static unsigned int A2results[Num_of_Results]; // compiler removes them
> > because
> >
> > static unsigned int A3results[Num_of_Results]; // they are not used
> >
> > void main(void)
> >
> > {
> >
> > WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
> >
> > P6SEL = 0x0F; // Enable A/D channel inputs
> >
> > ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
> >
> > // to avoid overflow of results
> >
> > ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
> >
> > ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0
> >
> > ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
> >
> > ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2
> >
> > ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.
> >
> > ADC12IE = 0x08; // Enable ADC12IFG.3
> >
> > ADC12CTL0 |= ENC; // Enable conversions
> >
> > ADC12CTL0 |= ADC12SC; // Start conversion
> >
> > _BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts
> >
> > }
> >
> > #pragma vector=ADC12_VECTOR
> >
> > __interrupt void ADC12ISR (void)
> >
> > {
> >
> > static unsigned int index = 0;
> >
> > A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared
> >
> > A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared
> >
> > A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared
> >
> > A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared
> >
> > index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
> > Breakpoint
> >
> > here
> >
> > }
> >
> >
> >
> > Once it goes into LPM0 and enter the interrupt vector, it loops within
> > endlessly.
> >
> > Can someone please advice on how can I exit from the interrupt vector after
> > capturing the results?
> >
> >
> >
> > Thank you.
> >
> >
> >
> > Best regards,
> >
> > Hui Choo
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>

#44285 From: "Michael" <mkusch@...>
Date: Thu Dec 31, 2009 1:10 pm
Subject: Re: ADC12 interrupt vector
tintronic
Send Email Send Email
 
> If you don't want to reply his questions, why do you bother posting?
Er, because UNLESS he answers OCY questions, it's just another 'do my homework'
(almost) cleverly desguised as a 'I want to learn'?. Read the post again, it's
quite obvious.

The first thing that gave him away was
> My requirements are:
And then the list of steps, copied from his homework assignment. No one I know
would write his requirements in such a way. Hmmm, thinking of it, there are some
people I know that do, they just happen teachers.

Then he posts the code
> taken from the demo program.

And finally he ends with the most simpliest observation of what is happening:
> Once it goes into LPM0 and enter the interrupt vector, it loops
> within endlessly.

Do you see any effort on his part? Any analysing what is happening? Any "i think
the problem is here/in this instruction/with this flag? Really, anything else
than a "here is what I need and here is some demo code. Tell me how to change it
to do what I need."? In other words, anything else than 'do my homework'?

Pascal, you're not a new member. You know how OCY, me and others respond in such
cases. Why does OCY answer bother you? It was the most politically correct way
to tell him to do his homework for himself, or at least put some thought and
work into his posting. This is, after all, a technical forum.

Regards,
Michael K.

--- In msp430@yahoogroups.com, "p_murayama" <pascal@...> wrote:
>
> Hello!
>
> If you don't want to reply his questions, why do you bother posting?
>
> Now to the original poster:
> I think I know what happens. You have compiled THE sample code, and you
> have set a breakpoint where the source tells you, at the last line of the
> interrupt service routine, right?
> Now what happens is that when you set a breakpoint, it stops the program
> where you tell it to. But as you ask for continuous sampling, immediately
> after you stopped, you have already another interrupt coming. Therefore,
> if you try to do a single step forwards, then you land again at the beginning
> of the interrupt routine.
>
> If you want to do steo by step within your ADC routine, then you have to
> disable interrupts first.
> Try this:
> __interrupt void ADC12ISR (void)  {
>     __DINT(); // Disable interrupts
> < same code as previously here >
>     __EINT(); // Enable interrupts
> }
>
> Then you will be able to step into your code.
>
> Pascal
>
> --- In msp430@yahoogroups.com, "old_cow_yellow" <old_cow_yellow@> wrote:
> >
> > You said: "The code is taken from the demo program."
> >
> > What is THE demo program?
> > What does that demo program demonstrate?
> > Why do you use the code of that demo program?
> >
> > --- In msp430@yahoogroups.com, "Toh Hui Choo" <hctoh@> wrote:
> > >
> > > Hi,
> > >
> > >
> > >
> > > I am having some problems understanding and need some help with the ADC12
> > > interrupt vector. My requirements are:
> > >
> > >
> > >
> > > 1)       A sequence of channels sampled and converted continuously,
> > > (CONSEQ_3)
> > >
> > > 2)       Converted results are stored in variable, A0results, A1results,
> > > A2results and A3results
> > >
> > > 3)       For averaging purposes, the data are captured 4 times
continuously
> > > and stored in to results.
> > >
> > > 4)       Process data
> > >
> > > 5)       Repeat step (1) again.
> > >
> > >
> > >
> > > The code is taken from the demo program.
> > >
> > >
> > >
> > > #include
> > >
> > > #define Num_of_Results 4
> > >
> > > static unsigned int A0results[Num_of_Results]; // These need to be global
in
> > >
> > > static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
> > > the
> > >
> > > static unsigned int A2results[Num_of_Results]; // compiler removes them
> > > because
> > >
> > > static unsigned int A3results[Num_of_Results]; // they are not used
> > >
> > > void main(void)
> > >
> > > {
> > >
> > > WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
> > >
> > > P6SEL = 0x0F; // Enable A/D channel inputs
> > >
> > > ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
> > >
> > > // to avoid overflow of results
> > >
> > > ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
> > >
> > > ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0
> > >
> > > ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
> > >
> > > ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2
> > >
> > > ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.
> > >
> > > ADC12IE = 0x08; // Enable ADC12IFG.3
> > >
> > > ADC12CTL0 |= ENC; // Enable conversions
> > >
> > > ADC12CTL0 |= ADC12SC; // Start conversion
> > >
> > > _BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts
> > >
> > > }
> > >
> > > #pragma vector=ADC12_VECTOR
> > >
> > > __interrupt void ADC12ISR (void)
> > >
> > > {
> > >
> > > static unsigned int index = 0;
> > >
> > > A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared
> > >
> > > A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared
> > >
> > > A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared
> > >
> > > A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared
> > >
> > > index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
> > > Breakpoint
> > >
> > > here
> > >
> > > }
> > >
> > >
> > >
> > > Once it goes into LPM0 and enter the interrupt vector, it loops within
> > > endlessly.
> > >
> > > Can someone please advice on how can I exit from the interrupt vector
after
> > > capturing the results?
> > >
> > >
> > >
> > > Thank you.
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Hui Choo
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>

#44286 From: "Hayashi, Steve" <shayashi@...>
Date: Thu Dec 31, 2009 1:56 pm
Subject: RE: Re: ADC12 interrupt vector
herlhayashi
Send Email Send Email
 
I have to agree to some extent, but based on his requirements, we can't even DO
his homework for him, even if we wanted.  Step 4 is so vague that I don't know
how to respond to that.  Based on what he's posted, he's still got some more
work to do.

But I'll provide an answer that I think he's looking for.  It's easily found in
other example code, but difficult to understand based on the datasheets alone.

So, in answer to the original post, you're missing the wake up part of the
interrupt function.  I believe that line is _BIC_SR_(LPM0_bits).  However, if
you don't understand why the interrupt function runs continuously, then you
should study the documentation for the ADC.  Because you will likely run into
problems if you just put that line at the end of your ADC ISR.

-Steve

From: msp430@yahoogroups.com [mailto:msp430@yahoogroups.com] On Behalf Of
Michael
Sent: Thursday, December 31, 2009 8:10 AM
To: msp430@yahoogroups.com
Subject: [msp430] Re: ADC12 interrupt vector



> If you don't want to reply his questions, why do you bother posting?
Er, because UNLESS he answers OCY questions, it's just another 'do my homework'
(almost) cleverly desguised as a 'I want to learn'?. Read the post again, it's
quite obvious.

The first thing that gave him away was
> My requirements are:
And then the list of steps, copied from his homework assignment. No one I know
would write his requirements in such a way. Hmmm, thinking of it, there are some
people I know that do, they just happen teachers.

Then he posts the code
> taken from the demo program.

And finally he ends with the most simpliest observation of what is happening:
> Once it goes into LPM0 and enter the interrupt vector, it loops
> within endlessly.

Do you see any effort on his part? Any analysing what is happening? Any "i think
the problem is here/in this instruction/with this flag? Really, anything else
than a "here is what I need and here is some demo code. Tell me how to change it
to do what I need."? In other words, anything else than 'do my homework'?

Pascal, you're not a new member. You know how OCY, me and others respond in such
cases. Why does OCY answer bother you? It was the most politically correct way
to tell him to do his homework for himself, or at least put some thought and
work into his posting. This is, after all, a technical forum.

Regards,
Michael K.

--- In msp430@yahoogroups.com<mailto:msp430%40yahoogroups.com>, "p_murayama"
<pascal@...> wrote:
>
> Hello!
>
> If you don't want to reply his questions, why do you bother posting?
>
> Now to the original poster:
> I think I know what happens. You have compiled THE sample code, and you
> have set a breakpoint where the source tells you, at the last line of the
> interrupt service routine, right?
> Now what happens is that when you set a breakpoint, it stops the program
> where you tell it to. But as you ask for continuous sampling, immediately
> after you stopped, you have already another interrupt coming. Therefore,
> if you try to do a single step forwards, then you land again at the beginning
> of the interrupt routine.
>
> If you want to do steo by step within your ADC routine, then you have to
> disable interrupts first.
> Try this:
> __interrupt void ADC12ISR (void) {
> __DINT(); // Disable interrupts
> < same code as previously here >
> __EINT(); // Enable interrupts
> }
>
> Then you will be able to step into your code.
>
> Pascal
>
> --- In msp430@yahoogroups.com<mailto:msp430%40yahoogroups.com>,
"old_cow_yellow" <old_cow_yellow@> wrote:
> >
> > You said: "The code is taken from the demo program."
> >
> > What is THE demo program?
> > What does that demo program demonstrate?
> > Why do you use the code of that demo program?
> >
> > --- In msp430@yahoogroups.com<mailto:msp430%40yahoogroups.com>, "Toh Hui
Choo" <hctoh@> wrote:
> > >
> > > Hi,
> > >
> > >
> > >
> > > I am having some problems understanding and need some help with the ADC12
> > > interrupt vector. My requirements are:
> > >
> > >
> > >
> > > 1) A sequence of channels sampled and converted continuously,
> > > (CONSEQ_3)
> > >
> > > 2) Converted results are stored in variable, A0results, A1results,
> > > A2results and A3results
> > >
> > > 3) For averaging purposes, the data are captured 4 times continuously
> > > and stored in to results.
> > >
> > > 4) Process data
> > >
> > > 5) Repeat step (1) again.
> > >
> > >
> > >
> > > The code is taken from the demo program.
> > >
> > >
> > >
> > > #include
> > >
> > > #define Num_of_Results 4
> > >
> > > static unsigned int A0results[Num_of_Results]; // These need to be global
in
> > >
> > > static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
> > > the
> > >
> > > static unsigned int A2results[Num_of_Results]; // compiler removes them
> > > because
> > >
> > > static unsigned int A3results[Num_of_Results]; // they are not used
> > >
> > > void main(void)
> > >
> > > {
> > >
> > > WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
> > >
> > > P6SEL = 0x0F; // Enable A/D channel inputs
> > >
> > > ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
> > >
> > > // to avoid overflow of results
> > >
> > > ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
> > >
> > > ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0
> > >
> > > ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
> > >
> > > ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2
> > >
> > > ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.
> > >
> > > ADC12IE = 0x08; // Enable ADC12IFG.3
> > >
> > > ADC12CTL0 |= ENC; // Enable conversions
> > >
> > > ADC12CTL0 |= ADC12SC; // Start conversion
> > >
> > > _BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts
> > >
> > > }
> > >
> > > #pragma vector=ADC12_VECTOR
> > >
> > > __interrupt void ADC12ISR (void)
> > >
> > > {
> > >
> > > static unsigned int index = 0;
> > >
> > > A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared
> > >
> > > A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared
> > >
> > > A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared
> > >
> > > A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared
> > >
> > > index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
> > > Breakpoint
> > >
> > > here
> > >
> > > }
> > >
> > >
> > >
> > > Once it goes into LPM0 and enter the interrupt vector, it loops within
> > > endlessly.
> > >
> > > Can someone please advice on how can I exit from the interrupt vector
after
> > > capturing the results?
> > >
> > >
> > >
> > > Thank you.
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Hui Choo
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>



[Non-text portions of this message have been removed]

#44287 From: "hartmut.seitter" <hartmut.seitter@...>
Date: Thu Dec 31, 2009 3:46 pm
Subject: msp430-gdbproxy ->error: msp430: Could not find device (or device not supported)
hartmut.seitter
Send Email Send Email
 
Hello,
I need some help to fix the error mentioned above.

I installed eclipse and MSPGCC (including giveio.sys) and I am not able to make
a connection between the parallel port of my PC (IBM thinkpad t41) and the
MSP430F149 with the olimex header board.

when I start msp430-gdbproxy --debug msp430 I get the following messages

debug:     msp430: msp430_open()
debug: MSP430_Initialize()
debug: MSP430_Configure()
debug: MSP430_VCC(3000)
debug: MSP430_Identify()
error:     msp430: Could not find device (or device not supported) (4)
debug: MSP430_VCC(0)
debug: MSP430_VCC(3000)
debug: MSP430_Reset(ALL_RESETS)
debug: MSP430_Close()
Assertion failed: !msp430_status.is_open, file target_msp430.c, line 745

--- The interesting point is that I am able to use the
IAR Embedded Workbench IDE and I am able to connect to the headerboard.
So headerboard is ok, parallel port is ok,  but I don't find the reason why
msp430-gdbproxy is not work.

I would like to change to the eclipse environment for program development for
the msp430f149.

Any recommendation is highly appreciated. Thanks in advance.

#44288 From: jci443 <jci443@...>
Date: Thu Dec 31, 2009 5:18 pm
Subject: Re: ADC12 interrupt vector
jci443
Send Email Send Email
 
Hello Hui Choo,

You are pretty close.

I find that sometimes I need to write a *very very simple* interrupt to make
sure I understand how the MSP430 flags work then I build from that
experience.

Here are some tips that might help:

Start with a simple Timer interrupt that updates a counter every 1 second.

Learn how to work the breakpoints, Watch window, enable/disable interrupts,
LPM0, etc.

Once you have a solid idea how a Timer interrupt works - try reading the A/D
*without* an interrupt.

Make sure you understand how the A/D displays the data to you.

Next try to average 4 readings from the A/D.

The last hurdle would be to take the lessons learned from the Timer
interrupt, the A/D and the Averaging routine and tie it all together in a
more complicated A/D interrupt.

Don't be discouraged - as Thomas Edison observed - ... 1% inspiration
followed by 99% perspiration...

Good luck

Juan Carlos





On Wed, Dec 30, 2009 at 9:16 PM, Toh Hui Choo <hctoh@...> wrote:

>
>
> Hi,
>
> I am having some problems understanding and need some help with the ADC12
> interrupt vector. My requirements are:
>
> 1) A sequence of channels sampled and converted continuously,
> (CONSEQ_3)
>
> 2) Converted results are stored in variable, A0results, A1results,
> A2results and A3results
>
> 3) For averaging purposes, the data are captured 4 times continuously
> and stored in to results.
>
> 4) Process data
>
> 5) Repeat step (1) again.
>
> The code is taken from the demo program.
>
> #include
>
> #define Num_of_Results 4
>
> static unsigned int A0results[Num_of_Results]; // These need to be global
> in
>
> static unsigned int A1results[Num_of_Results]; // this example. Otherwise,
> the
>
> static unsigned int A2results[Num_of_Results]; // compiler removes them
> because
>
> static unsigned int A3results[Num_of_Results]; // they are not used
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
>
> P6SEL = 0x0F; // Enable A/D channel inputs
>
> ADC12CTL0 = ADC12ON+MSC+SHT0_8; // Turn on ADC12, extend sampling time
>
> // to avoid overflow of results
>
> ADC12CTL1 = SHP+CONSEQ_3; // Use sampling timer, repeated sequence
>
> ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0
>
> ADC12MCTL1 = INCH_1; // ref+=AVcc, channel = A1
>
> ADC12MCTL2 = INCH_2; // ref+=AVcc, channel = A2
>
> ADC12MCTL3 = INCH_3+EOS; // ref+=AVcc, channel = A3, end seq.
>
> ADC12IE = 0x08; // Enable ADC12IFG.3
>
> ADC12CTL0 |= ENC; // Enable conversions
>
> ADC12CTL0 |= ADC12SC; // Start conversion
>
> _BIS_SR(LPM0_bits + GIE); // Enter LPM0, Enable interrupts
>
> }
>
> #pragma vector=ADC12_VECTOR
>
> __interrupt void ADC12ISR (void)
>
> {
>
> static unsigned int index = 0;
>
> A0results[index] = ADC12MEM0; // Move A0 results, IFG is cleared
>
> A1results[index] = ADC12MEM1; // Move A1 results, IFG is cleared
>
> A2results[index] = ADC12MEM2; // Move A2 results, IFG is cleared
>
> A3results[index] = ADC12MEM3; // Move A3 results, IFG is cleared
>
> index = (index+1)%Num_of_Results; // Increment results index, modulo; Set
> Breakpoint
>
> here
>
> }
>
> Once it goes into LPM0 and enter the interrupt vector, it loops within
> endlessly.
>
> Can someone please advice on how can I exit from the interrupt vector after
> capturing the results?
>
> Thank you.
>
> Best regards,
>
> Hui Choo
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]

#44289 From: "bhaltulpule" <bhaltulpule@...>
Date: Thu Dec 31, 2009 5:59 pm
Subject: Re: I2C Bus non repeatable performance----> Clarification
bhaltulpule
Send Email Send Email
 
Hi !
Thanks for your reply and questions. I need to clarify what I wrote.

Yes the MSP430's are set up for multimaster configuration. And I am using the
Beagle I2C bus analyzer from Total Phase. I see the non repeatable performance
on the Beagle screen. For example, when I attempt to just "Ping" from processor
#1 to #2 over I2C, sometimes I see all kinds of corrupt messages, partial
messages etc. where as I see perfectly clean correct XMT and RCV packets at
other times.. The code is the same !
This is why I am confused. Could it be the pull up resistors or other timing
issues with this code ? In other words, what to look for ?

Incidentally, the RS485 in on another UART port and has nothing to do with this.
Sorry for the confusion.

Any advice would be appreciated.


Thanks.

Bhal Tulpule

--- In msp430@yahoogroups.com, "Michael" <mkusch@...> wrote:
>
> One question: are there multiple I2C masters in your configuration or just
one? You say multiple processors, so I guess you mean more than just 2. If there
are many masters, how are you handling collisions?
>
> In any case, get a digital analyser and scope/decode the I2C bus. You can get
one for 149 US dollars and it will greatly improve your troubleshooting
productivity.
>
> The rest of your setup I don't understand. If you are having problems with
I2C, what has RS485 to do with anything?
>
> Take a step back, look at your problem, and write it again so ANYONE might
understand your setup.
>
> Regards,
> Michael K.
>
>
>
> --- In msp430@yahoogroups.com, "bhaltulpule" <bhaltulpule@> wrote:
> >
> > For my project I am using multiple MSP430F168 processors connected via a I2C
bus on USART0. The processors are isolated from each other via the ADUM1250. The
SDA and SCL lines for each proc are pulled up to +3.3V by a 1.8K resistor.  and
a RS485 serial bus on UART1. The RS485 direction is controlled by pin 3.5. My
ACLK is @ 8MHz.  The code for the device is attached.
> > The problem is that the I2C is very unpredictable, in that with the same
code, it runs sometimes and not othes. I have to try and recycle power sometimes
or download the same code sometimes or reset the processor thru CCE, but no
clear path  as to why this is happening and what to do about it. I cannot
release this into the end product with this flaky performance. So can you please
take a look and help me.
> >
> > I have taken the code from the fet140_i2c_14.c file in the example folder on
the TI site and modified it primarily for the clock and UASRT1. At eh moment the
UART is not working either but my main concern is the I2C non repeatable
performance. Is it the pull up or something in my code ?
> > **code*******
> >
//******************************************************************************
> > //   MSP-FET430P140 Demo - Switch Between UART0 & Master I2C Transmitter
> > //
> > //   Description: This code shows proper switching between UART and I2C
> > //   UART0 Puts out A-Z, CR, LF on the Hyperterminal Screen
> > //   and then Transmits 0x5A over I2C. This happens continuously
> > //   This is the I2C Master Code. For Slave, use fet140_i2c_07.c
> > //   ACLK = n/a, MCLK = SMCLK = I2CCLOCK = DCO ~ 800kHz
> > //   //* MSP430F169 Device Required *//
> > //
> > //                                 /|\  /|\
> > //                  MSP430F169     10k  10k     MSP430F169
> > //                    slave         |    |        master
> > //              -----------------|  |    |  -----------------
> > //             |             P3.1|<-|---+->|P3.1             |
> > //             |                 |  |      |             P3.4|--------->
> > //             |                 |  |      |                 |2400 - 8N1
> > //             |             P3.3|<-+----->|P3.3         P3.5|<---------
> > //             |                 |         |                 |
> > //
> > //
> > //
> > //  H. Grewal
> > //  Texas Instruments Inc.
> > //  Feb 2005
> > //  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
> >
//******************************************************************************
> >
> > #include  <msp430x16x.h>
> >
> >
> > void InitSerialPort(void);
> > void I2C_TX(void);                          // Function prototypes
> > void InitI2C(void);
> >
> >
> > void main(void)
> > {
> >  unsigned char i;
> >
> > 	 //Initialize System Clock for MCLK @ 8 MHz.
> > 	 BCSCTL1 |= XTS; 			  			  //LFXT1CLK in high-frequency mode (8 MHz); ACLK
= 8 MHz
> > 	 BCSCTL2 |= SELM_3 + DIVM_0;  //MCLK = LFXT1CLK (8 MHz); Not Divided;
> > 						 // SMCLK = LFXT1CLK because there is no X2 ??!!
> > 	 //Switch MCLK from DCO to LFXT1CLK
> >
> >   WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
> >   P1DIR |= 0x01;
> >   P1OUT = 0;
> >   P3SEL |= 0xCA;                            // UART1 and I2C pin option
select
> >   P3DIR |= 0x40;                          // P3.6 = output direction for
UART1 TXD
> >   P3OUT |= 0x20;                            // P3.5 = 1, for RS-485
Direction, Always XMT.
> >
> >   for (;;)
> >   {
> >
> >   InitSerialPort();
> >
> >   i = 'X';
> >   while (i != '\n' + 1 )
> >   {
> >     if (i==('Z'+1))
> >       i = '\r';
> >     else if (i==('\r'+1))                   // CR
> >       i = '\n';                             // LF
> >
> >     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer ready?
> >     U1TXBUF = i++;                           // Output a character
> >     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer empty?
> >   }
> >
> >
> >   InitI2C();
> >   I2C_TX();                                 // Transmit char over I2C
> >   }
> > }
> >
> > void InitSerialPort(void)
> > {
> >   I2CIE = 0x00;
> >   U1CTL = 0;                                // **clear U1CTL register**
> >   U1CTL = SWRST;                            // **Reset UART state machine**
> >   UCTL1 |= CHAR;                            // 8-bit character;8-N-1.
> >   U1TCTL |= SSEL1;                          // UCLK = ACLK
> >  U1BR0  = 0x41;//9600 Baud-> 8MHz/9600 =~883 = 341h.
> >  U1BR1  = 0x03;                             //BT for 9600 baud
> > //  UMCTL0 = 0x6B;                            // Modulation
> > //  UMCTL0 = 0x00;
> >  ME2  |= UTXE1 + URXE1;//rx tx modules enabled...not 0
> >   U1CTL &= ~SWRST;                          // Initialize USART1 state
machine
> >  IE2  |= URXIE1 + UTXIE1;//RX interrupt (URXIFG1) enabled..not 0
> > }
> >
> > void I2C_TX(void)
> > {
> >   while (I2CBUSY & I2CDCTL);                // I2C ready?
> >   I2CTCTL |= I2CSTT+I2CSTP+I2CTRX;          // Initiate transfer
> >   I2CDRB = 0x5A;                            // Copy data to I2CDRB
> >   while (I2CBUSY & I2CDCTL);                // I2C ready?
> >   while (I2CBB & I2CDCTL);                  // I2C ready?
> >   P1OUT = 0x01;
> >   P1OUT = 0;
> > }
> >
> > void InitI2C(void)
> > {
> >   U0CTL |= SWRST;                           // Reset USART state machine
> >   U0CTL &= ~CHAR;
> >   U0CTL |= I2C+SYNC;                        // Recommended I2C init
procedure
> >   U0CTL &= ~I2CEN;                          // Recommended I2C init
procedure
> >   	 I2CSCLH = 0x07; 				 //Reduced I2C Speed
> >   	 I2CSCLL = 0x06;
> >   	 I2CPSC = 0x00;
> >   I2CTCTL |= I2CSSEL1;                      //Select ACLK = LFXT1CLK
> >   I2CSA = 0x0048;                           // Address of Slave
> >   U0CTL |= MST;                             // Master mode
> >   I2CNDAT = 0x01;                           // Write one byte
> >   U0CTL |= I2CEN;                           // Enable I2C
> > }
> >
>

#44290 From: "Redd, Emmett R" <EmmettRedd@...>
Date: Thu Dec 31, 2009 9:23 pm
Subject: RE: Re: I2C Bus non repeatable performance----> Clarification
emmettredd
Send Email Send Email
 
If you are multimaster, you need to answer Michael's question about "how are you
handling collisions?"  Don't worry about pull up resistors or other timing
issues.  In other words, look for collisions.

Emmett Redd Ph.D.   mailto:EmmettRedd@...
Professor                                 (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University             Fax (417)836-6226
901 SOUTH NATIONAL                   Lab (417)836-3770
SPRINGFIELD, MO  65897   USA    Dept (417)836-5131

"In theory there is no difference between theory and practice. In practice there
is." -- Yogi Berra or Jan van de Snepscheut

________________________________________
From: msp430@yahoogroups.com [msp430@yahoogroups.com] On Behalf Of bhaltulpule
[bhaltulpule@...]
Sent: Thursday, December 31, 2009 11:59 AM
To: msp430@yahoogroups.com
Subject: [msp430] Re: I2C Bus non repeatable performance----> Clarification

Hi !
Thanks for your reply and questions. I need to clarify what I wrote.

Yes the MSP430's are set up for multimaster configuration. And I am using the
Beagle I2C bus analyzer from Total Phase. I see the non repeatable performance
on the Beagle screen. For example, when I attempt to just "Ping" from processor
#1 to #2 over I2C, sometimes I see all kinds of corrupt messages, partial
messages etc. where as I see perfectly clean correct XMT and RCV packets at
other times.. The code is the same !
This is why I am confused. Could it be the pull up resistors or other timing
issues with this code ? In other words, what to look for ?

Incidentally, the RS485 in on another UART port and has nothing to do with this.
Sorry for the confusion.

Any advice would be appreciated.


Thanks.

Bhal Tulpule

--- In msp430@yahoogroups.com, "Michael" <mkusch@...> wrote:
>
> One question: are there multiple I2C masters in your configuration or just
one? You say multiple processors, so I guess you mean more than just 2. If there
are many masters, how are you handling collisions?
>
> In any case, get a digital analyser and scope/decode the I2C bus. You can get
one for 149 US dollars and it will greatly improve your troubleshooting
productivity.
>
> The rest of your setup I don't understand. If you are having problems with
I2C, what has RS485 to do with anything?
>
> Take a step back, look at your problem, and write it again so ANYONE might
understand your setup.
>
> Regards,
> Michael K.
>
>
>
> --- In msp430@yahoogroups.com, "bhaltulpule" <bhaltulpule@> wrote:
> >
> > For my project I am using multiple MSP430F168 processors connected via a I2C
bus on USART0. The processors are isolated from each other via the ADUM1250. The
SDA and SCL lines for each proc are pulled up to +3.3V by a 1.8K resistor.  and
a RS485 serial bus on UART1. The RS485 direction is controlled by pin 3.5. My
ACLK is @ 8MHz.  The code for the device is attached.
> > The problem is that the I2C is very unpredictable, in that with the same
code, it runs sometimes and not othes. I have to try and recycle power sometimes
or download the same code sometimes or reset the processor thru CCE, but no
clear path  as to why this is happening and what to do about it. I cannot
release this into the end product with this flaky performance. So can you please
take a look and help me.
> >
> > I have taken the code from the fet140_i2c_14.c file in the example folder on
the TI site and modified it primarily for the clock and UASRT1. At eh moment the
UART is not working either but my main concern is the I2C non repeatable
performance. Is it the pull up or something in my code ?
> > **code*******
> >
//******************************************************************************
> > //   MSP-FET430P140 Demo - Switch Between UART0 & Master I2C Transmitter
> > //
> > //   Description: This code shows proper switching between UART and I2C
> > //   UART0 Puts out A-Z, CR, LF on the Hyperterminal Screen
> > //   and then Transmits 0x5A over I2C. This happens continuously
> > //   This is the I2C Master Code. For Slave, use fet140_i2c_07.c
> > //   ACLK = n/a, MCLK = SMCLK = I2CCLOCK = DCO ~ 800kHz
> > //   //* MSP430F169 Device Required *//
> > //
> > //                                 /|\  /|\
> > //                  MSP430F169     10k  10k     MSP430F169
> > //                    slave         |    |        master
> > //              -----------------|  |    |  -----------------
> > //             |             P3.1|<-|---+->|P3.1             |
> > //             |                 |  |      |             P3.4|--------->
> > //             |                 |  |      |                 |2400 - 8N1
> > //             |             P3.3|<-+----->|P3.3         P3.5|<---------
> > //             |                 |         |                 |
> > //
> > //
> > //
> > //  H. Grewal
> > //  Texas Instruments Inc.
> > //  Feb 2005
> > //  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.21A
> >
//******************************************************************************
> >
> > #include  <msp430x16x.h>
> >
> >
> > void InitSerialPort(void);
> > void I2C_TX(void);                          // Function prototypes
> > void InitI2C(void);
> >
> >
> > void main(void)
> > {
> >  unsigned char i;
> >
> >             //Initialize System Clock for MCLK @ 8 MHz.
> >             BCSCTL1 |= XTS;
//LFXT1CLK in high-frequency mode (8 MHz); ACLK = 8 MHz
> >             BCSCTL2 |= SELM_3 + DIVM_0;             //MCLK = LFXT1CLK (8
MHz); Not Divided;
> >                                                     // SMCLK = LFXT1CLK
because there is no X2 ??!!
> >             //Switch MCLK from DCO to LFXT1CLK
> >
> >   WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
> >   P1DIR |= 0x01;
> >   P1OUT = 0;
> >   P3SEL |= 0xCA;                            // UART1 and I2C pin option
select
> >   P3DIR |= 0x40;                          // P3.6 = output direction for
UART1 TXD
> >   P3OUT |= 0x20;                            // P3.5 = 1, for RS-485
Direction, Always XMT.
> >
> >   for (;;)
> >   {
> >
> >   InitSerialPort();
> >
> >   i = 'X';
> >   while (i != '\n' + 1 )
> >   {
> >     if (i==('Z'+1))
> >       i = '\r';
> >     else if (i==('\r'+1))                   // CR
> >       i = '\n';                             // LF
> >
> >     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer ready?
> >     U1TXBUF = i++;                           // Output a character
> >     while (!(IFG2 & UTXIFG1));              // UART1 TX buffer empty?
> >   }
> >
> >
> >   InitI2C();
> >   I2C_TX();                                 // Transmit char over I2C
> >   }
> > }
> >
> > void InitSerialPort(void)
> > {
> >   I2CIE = 0x00;
> >   U1CTL = 0;                                // **clear U1CTL register**
> >   U1CTL = SWRST;                            // **Reset UART state machine**
> >   UCTL1 |= CHAR;                            // 8-bit character;8-N-1.
> >   U1TCTL |= SSEL1;                          // UCLK = ACLK
> >     U1BR0    = 0x41;//9600 Baud-> 8MHz/9600 =~883 = 341h.
> >     U1BR1    = 0x03;                             //BT for 9600 baud
> > //  UMCTL0 = 0x6B;                            // Modulation
> > //  UMCTL0 = 0x00;
> >     ME2             |= UTXE1 + URXE1;//rx tx modules enabled...not 0
> >   U1CTL &= ~SWRST;                          // Initialize USART1 state
machine
> >     IE2             |= URXIE1 + UTXIE1;//RX interrupt (URXIFG1) enabled..not
0
> > }
> >
> > void I2C_TX(void)
> > {
> >   while (I2CBUSY & I2CDCTL);                // I2C ready?
> >   I2CTCTL |= I2CSTT+I2CSTP+I2CTRX;          // Initiate transfer
> >   I2CDRB = 0x5A;                            // Copy data to I2CDRB
> >   while (I2CBUSY & I2CDCTL);                // I2C ready?
> >   while (I2CBB & I2CDCTL);                  // I2C ready?
> >   P1OUT = 0x01;
> >   P1OUT = 0;
> > }
> >
> > void InitI2C(void)
> > {
> >   U0CTL |= SWRST;                           // Reset USART state machine
> >   U0CTL &= ~CHAR;
> >   U0CTL |= I2C+SYNC;                        // Recommended I2C init
procedure
> >   U0CTL &= ~I2CEN;                          // Recommended I2C init
procedure
> >             I2CSCLH = 0x07;                                        
//Reduced I2C Speed
> >             I2CSCLL = 0x06;
> >             I2CPSC = 0x00;
> >   I2CTCTL |= I2CSSEL1;                      //Select ACLK = LFXT1CLK
> >   I2CSA = 0x0048;                           // Address of Slave
> >   U0CTL |= MST;                             // Master mode
> >   I2CNDAT = 0x01;                           // Write one byte
> >   U0CTL |= I2CEN;                           // Enable I2C
> > }
> >
>




------------------------------------

To unsubscribe from the msp430 group, send an email to:
msp430-unsubscribe@egroups.com

Yahoo! Groups Links



     http://docs.yahoo.com/info/terms/

#44291 From: "reotrb" <rob.a.koch@...>
Date: Fri Jan 1, 2010 12:40 am
Subject: Basic SPI port question
reotrb
Send Email Send Email
 
I'm new to the MSP430, and I've written some basic code for the SPI port.  It
compiles fine but nothing seems to come out the port when I run it.

More specifically I'm using the new MSP430F5529.  The SPI port I'm using is
UCB0.  In this case the MSP430 is the master and there is one slave device.  I
want the SPI port to operate in "3 Pin Mode".  Please find the code below.  If
someone could give me some pointers on how to fix it I'd be very appreciative.

Thanks,
Rob


#include "msp430.h"
int main(void)
{
   WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer

   //**SET UP UCB0 as SPI PORT******************//
   // 1)Set UCSWRST
   UCB0CTL1 = 129; //0b10000001 this keeps USCI in reset and also selects SMCLK
as source clock

   // 2)Initialize all USCI registers with UCSWRST=1 (including UCxCTL1).
   UCB0CTL0 = 9; //0b00001001 Master mode, Synchronous mode
   UCB0BR0 = 226; //0b11100010
   UCB0BR1 = 4; //0b00000100

   // 3)Configure ports
   P3DIR = 5; //0b00000101 P3.0 is output, P3.1 input, P3.2 output
   P1DIR = 184;//0b10111000
   P1DIR = 128;

   // 4)Clear UCSWRST via software
   UCB0CTL1 = 128; //0b10000000


   UCB0TXBUF = 138; //Send test byte.

   while(1);
}

#44292 From: "old_cow_yellow" <old_cow_yellow@...>
Date: Fri Jan 1, 2010 6:07 am
Subject: Re: Basic SPI port question
old_cow_yellow
Send Email Send Email
 
You may need to set:
  P3SEL = 7; //0b00000111

--- In msp430@yahoogroups.com, "reotrb" <rob.a.koch@...> wrote:
>
> I'm new to the MSP430, and I've written some basic code for the SPI port.  It
compiles fine but nothing seems to come out the port when I run it.
>
> More specifically I'm using the new MSP430F5529.  The SPI port I'm using is
UCB0.  In this case the MSP430 is the master and there is one slave device.  I
want the SPI port to operate in "3 Pin Mode".  Please find the code below.  If
someone could give me some pointers on how to fix it I'd be very appreciative.
>
> Thanks,
> Rob
>
>
> #include "msp430.h"
> int main(void)
> {
>   WDTCTL = WDTPW + WDTHOLD;             // Stop watchdog timer
>
>   //**SET UP UCB0 as SPI PORT******************//
>   // 1)Set UCSWRST
>   UCB0CTL1 = 129; //0b10000001 this keeps USCI in reset and also selects SMCLK
as source clock
>
>   // 2)Initialize all USCI registers with UCSWRST=1 (including UCxCTL1).
>   UCB0CTL0 = 9; //0b00001001 Master mode, Synchronous mode
>   UCB0BR0 = 226; //0b11100010
>   UCB0BR1 = 4; //0b00000100
>
>   // 3)Configure ports
>   P3DIR = 5; //0b00000101 P3.0 is output, P3.1 input, P3.2 output
>   P1DIR = 184;//0b10111000
>   P1DIR = 128;
>
>   // 4)Clear UCSWRST via software
>   UCB0CTL1 = 128; //0b10000000
>
>
>   UCB0TXBUF = 138; //Send test byte.
>
>   while(1);
> }
>

Messages 44263 - 44292 of 51687   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help