6 Replies Latest reply: Feb 24, 2010 3:19 AM by DarrylBurke RSS

    XT75 and ADC IN ports

    843851
      Hi everyone!!

      I'm working with a Siemnes Xt75. I need to read (in the same time) the 2 ports ADC_IN to read 2 voltages (at the frequency of 10 Hz).

      I'm using the commands

      ATCmd.send("AT^SRADC=0,1,100\r"); and
      ATCmd.send("AT^SRADC=1,1,100\r");

      What I have in output is some measures with the values of channel 0 at both channels and some measures with the values of channel 1 at both channels.
      So I read the same thing to both channels (what I read instead needs to be different).

      Anyone has had the same problem?
      Any suggestions?
      Thank to who can answer me
        • 1. Re: XT75 and ADC IN ports
          843851
          Hi GabPicci !
          XT75 is belongs to JSR 228 (IMP-NG) and it is a subset of MIDP/ CLDC. You must be using generic connection framework to open the comm connection in the device. like
          CommConnection comConnection= (CommConnection)Connector.open(″comm:com0;baudrate=19200″);
          InputStream comConnection= comConnection.openInputStream();
          // read your data...
          what is your problem with two opened comm connections ?

          -Jestan
          • 2. Re: XT75 and ADC IN ports
            843851
            Hi Jestan!!

            I want to read the voltage at the 2 ports ADC_IN.
            I send the command to begin to sample and then I wait the URC to arrive.

            ATCmd.send("AT^SRADC=0,1,100\r"); and
            ATCmd.send("AT^SRADC=1,1,100\r");

            With an ATCommandListener I wait the URC (message like ^SRADC: 0 oppure 1):
            class ATListener implements ATCommandListener {
                    public void ATEvent(String Event) {
                        try {
                        if (Event.indexOf("^SRADC")>0) {
                            tipoFile = 1;
                            SalvaDati(Event, fconn, file_out, fconn2, file2_out);
                            
                        }    
                        } else {
                            System.out.println("ALTRO: " + Event);
                        }
                        } catch(NullPointerException atex) {
                            System.out.println("ATEX " + atex.getMessage());
                            atex.printStackTrace();
                            System.out.println("EVENTO NULLO " + Event);
                        }
                        
                    }
            (it isn't all the code to listen the URC)

            When I save the URC messages in a text file, I have a situation like this (I have put a battery of 1,5 V on the channel 1 and I have short the channel 0 to ground):

            ^SRADC: 0,9,0,0,0,0,0,-1,0,0,0
            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 1,10,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,10,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 1,10,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 1,10,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,9,0,0,0,0,0,-1,0,0,0
            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,9,0,0,0,0,0,-1,0,0,0
            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499

            or a situation like this

            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,10,0,0,0,0,0,0,0,0,0,0
            ^SRADC: 1,10,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,9,0,0,0,1,0,0,0,1,0
            ^SRADC: 1,9,0,0,0,0,0,0,0,0,0
            ^SRADC: 0,10,0,0,0,0,0,0,0,0,0,0
            ^SRADC: 1,9,0,0,0,0,0,-1,0,0,0
            ^SRADC: 0,10,0,0,0,0,0,0,0,0,0,0
            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,10,0,0,0,0,0,0,0,0,0,0
            ^SRADC: 1,10,1498,1499,1499,1499,1499,1499,1499,1499,1499,1499

            Instead I want a situation like this:

            ^SRADC: 0,9,0,0,0,1,0,0,0,1,0
            ^SRADC: 1,10,1499,1499,1499,1499,1498,1499,1499,1499,1498,1498
            ^SRADC: 0,10,0,0,0,1,0,0,1,0,0,0
            ^SRADC: 1,10,1499,1499,1499,1499,1499,1499,1499,1499,1499,1499
            ^SRADC: 0,10,0,0,0,0,0,0,0,0,0,0
            ^SRADC: 1,9,1499,1499,1499,1499,1499,1499,1499,1499,1499

            You can see how I receive the same voltage to the 2 ports. And there isn't a favoured port.
            You think that if I read these messages from the commconnection I can read the right results?

            I have the same situation also if I send the AT command in the Hyperterminal.

            Thx for the reply
            Any suggestion?
            • 3. Re: XT75 and ADC IN ports
              843851
              Hi GabPicci !
              Sorry for my previous reply. I did not develop applications TC65/XT75 and I did not know that it has AT Command API until I saw this post.As TC65/XT75 manual says AT Command is favorable for reading status report from URC. Since, you don't have any data connection to read the voltage values, I doubt that it will work using reading from inputstream.

              I have look the AT Command set manual and it says, you have to recalculate measured voltage values from ADC1_IN,ADC2_IN to get the actual values..

              using AT^SAADC?

              Response(s)
              ^SAADC: <ofs1>, <amp1>, <ofs2>, <amp2>

              equation for recalculation ADC1_IN Value = (<value> from AT^SRADC - <ofs1>) <amp1> / 4096
              equation for recalculation ADC2_IN Value = (<value> from AT^SRADC - <ofs2>) <amp2> / 4096

              Besides the above thing I also don't know why your getting same values for both ports. I think you better use following commands to check the status of ADC1_IN, ADC2_IN before start reading.

              AT^SRADC=?
              ^SRADC:(list of supported <ch>s), (list of supported <oc>s), (list of supported <it>s)

              or increase the frequency and see (more than 100ms).

              or you better dig into the [http://www.automation.siemens.com/download/internet/cache/3/1431392/pub/de/TC65_atc_v02000.pdf|AT Command Set Manual]

              -Jestan
              • 4. Re: XT75 and ADC IN ports
                843851
                Hi Jestan!

                I have read in the pdf you send me, that the command for adjust the measured voltage vaues for the ADC ports (the AT^SAADC) is available only for the Terminal TC65.

                Then you are suggesting me to use the read command AT^SRADC=? before I read the URC? or when?

                Besides, have you worked with which processor? (I have other question to make)

                Sorry for the trouble I'm causing.

                GabPicci

                Edited by: GabPicci on Sep 2, 2009 12:52 AM
                • 5. Re: XT75 and ADC IN ports
                  843851
                  I just wanted to say 'hi'. I'm also developing an application on the XT65. Is there a dedicated forum for the XT65 and family?

                  All the best,

                  Chris.
                  • 6. Re: XT75 and ADC IN ports
                    DarrylBurke
                    gemstone, welcome to the forum. Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.

                    I'm locking this thread now.

                    db