I2C with ARM embedded receiving incorrect data

Hi together
For a schools project, which I must finish until next week, I need to read out a DS1307 RealTimeClock via I2C.
I am using a LM3S8962.
I have tried to communicate via the NI USB-8451 module, which worked just fine.
Now I only need to read out the Data from the DS1307 and I used the ARM embedded I2C VIs. I receive some data, but the Data is not correct (for example it shows a value of 70 in the seconds-register which is not possible).
I've tried a lot of things but I couldn't get it to work properly.
Attached a screenshot of how I implemented the reading of I2C. What am I doing wrong? I have really to get this working otherwise I can't finish my project and this would unfortunately result in a bad mark I hope someone can help me.
Regards from Switzerland
Dominic
Solved!
Go to Solution.
Attachments:
i2c_problem.JPG ‏46 KB

Hi doh,
are you sure you are reading from the right register? 
According to this datasheet: DS1307.pdf , 
if you want to access the seconds register it would be Adress 0 (Hex-Value-0), in your screenshot its 68 decimal. You can change the representation of your constant which is connected to the Adress terminal of your Create Configuration Reference VI. Just right click your constant -> visible object -> Radix. After that you can change the representation to x (HEX).
Additionally when you read the 7 bits which are casted to 8 bit unsigned you have to notice that the 7 bits are encoded as BCD code.
So consider your example reading the value 70: 70 in binary means: 100110 with the most significant bit on the left side and the least significant bit on the right side. Now when you split the values according to the seconds in the datasheets table:
| 0 | 1 0 0 | 0 1 1 0  
Then you will see, that 70 as U8 value has : 0110 = 6 (last 4 bits) and 100 (middle 3 bits) = 4, which means, that your actual value is not 70, but 46.
So I would guess, you have to convert the U8 value to an Boolean array, split the bits according to the Table mentioned in the manual and then convert them to the proper time.
Hope this helps, if you have further questions just post.
With best Regards,
Lam

Similar Messages

  • I am having trouble with the calendar displaying incorrect dates and times

    I am currently receiving calendar invites that i know are displaying incorrectly in my calendar and i am unsure how to fix this.

    Yes its all correct. I have just discovered that a separate calendar was set up with incorrect settings from the originator. I have checked all my settings and I'm good to go. thanks for your response

  • Problem  with BC4J in 10g: incorrect Date formatting

    I have PL/SQL procedure, which is called from bc4j-struts-application like this:
    CallableStatement cs = getDBTransaction().createCallableStatement(FIND_USER_RESP_STMT,0);
    cs.execute();
    It return an exeption with this message:
    ORA-01403: no data found
    ORA-06512: at "CRN.CRN_UTIL", line 115
    ORA-06512: at "CRN.CRN_UTIL", line 323
    ORA-06512: at "CRN.CRN_RESPONSIBILITY", line 85
    ORA-01843: not a valid month
    ORA-06512: at line 1
    I don't send any data parameter for this procedure. When I try to call it from JDeveloper connections debug, it runs succesfully. I try to create bc4j entity to query:
    select to_char(sysdate, 'DD-MON-YYYY') X,
    to_char(sysdate, 'DD-MM-YYYY') Y from dual
    and it retrieves:
    27-¿¿¿-2004
    27-09-2004
    Date constant is used in PL/SQL procedure with format 'DD-MON_YYYY', but I can't change it, because it used by many other applications.
    My local setting is english, USA, and I have the second language on my PC - russian.
    JDeveloper 9.0.5.2. This code runs succesfully in JDeveloper 9.0.3.3.
    How can I send bc4j date setting in normal format to solve this problem? And where can I find bc4j local settings, which are sended by bc4j to server?
    Regards, Nikolay

    Hello,
    The problem is still available. Could anybody help?
    Regard

  • Get-WMI Object (0x800706F7) - The stub received bad data

    Hello there,
    i have an problem related to the above error..
    When i do a remote wmi call and pass the credentials like this (from an script)
    $passS =[ServerEye.PowerShellAPI]::Decrypt($pass)
    $securePass = convertto-securestring $passS -asplaintext -force
    $credential = New-Object System.Management.Automation.PsCredential("$domain\$user",$securePass)
    $buffer = gwmi -Query "select * from Win32_PerfFormattedData_MSExchangeRpcClientAccess_MSExchangeRpcClientAccess" -Credential $credential -Authentication Default -ComputerName $computer -ErrorAction Stop
    i sometimes get the above error with the stub received bad data...
    When i open a new powershell and do the wmi request it works.. When i close the powershell.exe and execute the above code again from the same script it works. But sometimes (totally) random this issue occurs for the existing powershell.exe process and will
    never go away till i close the process (which is not option, since i am using a deamon which runs script from a queue folder.. and this deamon runs for a long time.. 
    When i restart the server.. this issue never occurs for a long time but then suddenly reoccurs. 
    Anyone has an idea? I found one similar thread, but in this the solution was to pass the credential data in a server\user format or an domain\user format, which i am doing
    Is this a bug? Is this an scripting flaw from my side? What can i do against it... Any help would be really cool!!

    Thank you in advance for your answer. This is somehow what i expected..
    Sadly those are not our own servers. They are from a customer that is using our script to monitor several aspects.. and of course the software is always to blame :D (From a customer perspective).
    But i will inform the customer because this connection issue could be absolutly possible since i also see powershell sessions that get broken due to server communication..
    The only thing i really do not understand is, why it does not "repair" itselfs. What is the difference between closing the powershell.exe or simply re-executing the same get-wmiobject request..  I dont know how get-wmiobject manages its connection..
    but shouldn it do a new connection to the remote-server for each call?

  • I received an email with an embedded QuickTime song. It plays but I would like to save it to my device so I may bypass retrieving it via email. How do I do this?

    I have an iPhone4. I thought it came with the QuickTime application but cannot find it currently installed in my phone. I received an email with an embedded QuickTime song how can I bypass the email and save the music to my device? There is no difficulty accessing or playing the music.

    Thanks Michael, this truth gradually became clear to me as I experimented. 
    Here's my workaround:  Label the audio track something other than music and it will sync.  It this case I called it a podcast and I could transfer the audio.
    I will be provideing feedback to Apple but I am sure it's something they must be working on. 
    At the moment the only way to send an audio track labeled MUSIC to your iCloud enabled iPhone is to drag it into iTunes, upload it to the cloud, put it in a playlist, sync the iPhone then go to that synced playlist and re-download the track.  Cumbersome doesn't quite capture it.  Facepalm gets closer.
    Looking forward to seeing iCloud mature.

  • I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.

    I am having problems interacting with Microsoft Office programs since the last update:cannot create a pdf through the 'print' menu in exel and both Word and Exel docs sent in Mac Mail end up being received as .dat files.
    Both these situations have cropped up on my MacBook Pro since the last update.
    Thanks for your help.
    Cheers
    Bob

    The 'Winmail.dat' problem has been extensively covered in these forums, I would search for that (a Google search works well) and unfortunately I have not seen the pdf print problem before, but assuming the software is current and functions normally (other than the pdf print problem) I have no suggestion other than the obvious (but time consuming) re-installation of Office.
    I wish I had more

  • BOXIR2 FP4.6 -WebI report with merged dimensions: Incorrect data

    Issue: BOXIR2 FP 4.6 -WebI report with merged dimensions: Max value of an object from second query is displayed in the report even when the formula is based on the object from the first Query.
    Data displays properly on BOXIR2 SP2.
    Steps to reproduce.
    1.Use u2018Island Resort Marketingu2019 Universe to create a WebI report.
    2. Create a Query with objects u2018Reservation Dateu2019 and u2018Future guestsu2019 and apply a query filter where the u2018Reservation Dateu2019 is between 1/1/2001 and 31/1/2001 an Run the query.
    3. Add a second Query with the same objects i.e. u2018Reservation Dateu2019 and u2018Future guestsu2019 and apply a query filter where the u2018Reservation Dateu2019 is between 1/1/2001 and 31/12/2001.
    4. Create a report variable MaxDate using the syntax "=Max([Query 1].[Reservation Date]) In Report"
    5. Use the objects u2018Reservation Date Query 2u2019, u2018Future guests Query 2u2019 and u2018MaxDateu2019 variable to create a table in the report.
    You will find the Maxdate column displays Max date values of u2018Reservation Date Query 2u2019 instead of u2018Reservation Date Query 1u2019.
    Could you please advice me on this issue.

    Hi Hiteshwar,
    MaxDate variable returns a maximum of Reservation date  from Query 1 i.e. 1/15/01 which is correct. If you put that variable separately it will display that date correctly but you are grouping it along with objects from the query2 thatu2019s why it is displaying correct value for Query 2 where it finds 1/15/01, but for other values WEBI canu2019t group this value as it refers its formula which contains Query 1 reservation date.
    Hence we canu2019t say it is displaying values from Query 2 it is taking values from Query1 itself  for 1/15/2001 and for remaining values it is taking non matching values from Query 2 with which it is grouping.
    If you put that variable with objects from Query1 it wonu2019t display 1/15/01 but all values reservation date from query 1 contains because it is grouping based on reservation date though it is single max value.
    Even when you write "=Max(Query 2.Reservation Date) formula and use it with objects from query 1 though it contains so many values it matches (Groups) only the values from reservation date from Query 1.and displays only those values i.e. 1/1/2001 and 1/15/01.
    MaxDate returns 1/15/01 as Maximum Date value from Query 1 but Query 2 contains value far more greater than 1/15/01 hense that will be more incorrect data if WEBI displays maxdate as 1/15/01 along with Query 2 objects.
    Here we can avoid this behavior by Custom SQL but MaxDate is a report level variable hence we canu2019t edit SQL.
    If your data contains some duplicate values WEBI will repeat MaxDate value like
    Reservation date     Restaurant           Future_Guests    Total Guests 
    1/1/01                          ABC                         3                   3     
    1/15/01                       XYZ                          4                   8    
    1/16/01                       XYZ                          4                   8  
    By default, WEBI Groups Total Guests based on the Restaurant and Reservation Date, but if we want we can group those values based only on Restaurant which will duplicate Total Guest values for Restaurant XYZ. But you report contains only one dimension with all unique Values we canu2019t group those.
    I hope this is clear.
    Thanksu2026
    Pratik

  • Why I receive Winmail.Dat instead of list of attachments with Email?

    I am receiving Winmail.DAT file as an attachment with email that contain large attachments. I can not view the Attachments, nor can I reterive this .dat file. How can I change the settings in MAIL. Any body can guide plz.?

    Mac OS X Mail: What is a winmail.dat attachment? : Apple ...
    Download TNEFs Enough for Mac - Extract winmail.dat ...
    Winmail.dat | OfficeforMacHelp.com
    How to Open Winmail.dat Files | Mac|Life

  • Program LPC2378 with code generated by LabView ARM embedded, without using LabView

    I would like to use the C files that are originally generated in LabVIEW ARM embedded module, and use Keil software (or other lower cost) to load these files into custom boards with LPC2378 controller without LabView.  Are there detailed instuctions for this?  I am using version 8.6 and the ARM embedded module is 1.1.  
    My reason for this task is boards are being made in a maufacturing facility oversees, and they need to be programmed at their end. 
    I read a forum describing the use of  hex files, but not enough detail for me to figure this out.
    Thanks in advance.

    Hey Bob,
    What you're looking to do should be possible. You'll just need to build the application in LabVIEW, then you should be able to use the uVisions command line to deploy the system. As for the C code itself, it gets generated when you build your build specification and you should see it placed in the same directory as your labview project in a folder named the name of your project. For example, if your project were called My ARM Project, you'll see a folder called "My ARM Project" created/updated whenever you build the build specification in that project and it will contain the C Code. To see the code organized logically, after building your build specification, right-click on the ARM target and select "Show Keil uVision". This will open a uVision window in "LabVIEW mode" and you'll be able to see all of the C files associated with you application; your VI specific code will be under a folder titled "VIs". You could also just open the C code files from disk in uVision, which is what you'll need to do if LabVIEW isn't installed. The main LabVIEW project can be found in the built directory described above as the LabVIEW.uvproj file in the "target"/Application/"uvision version"/Project directory. For example my main file was built in MyProject\EK_LM3S8962\Application\4.01\Project. From there, you'll need to follow uVision's process for compiling and deploying the target code from their command line:
    Command Line
    http://www.keil.com/support/man/docs/uv4/uv4_comma​ndline.htm
    Hope this helps!
    --Ryan_S

  • How can I change incorrect "date received" info in Mail?

    When I switched to Mavericks I had to leave behind Eudora, which I liked.  I started using Mail, but when Mail imported my email files from Eudora it misdated many of the files, using the date the file was imported as the "date received".  Since I use the date to help me keep track of sequencing of emails received, having this incorrect date thrown in is a problem, but I can't find any way to correct it.
    Exactly how can I correct the "date received" on mislabeled emails?  The dates were correct in my Eudora files, but I can't access those any more now that I'm on Mavericks, so I'm going to have to manually check the emails to find the dates in the headers or message contents.
    I'm not highly tech savvy, so if I have to go into the Terminal, I'll have to know exactly what prompts to look for and what specific information to provide, and in what format.
    Help!

    Hi Stuart.
    Open /Applications/Utilities/Terminal, type the following command (you can just copy it here, paste in a text editor, modify the email address, then copy the whole command again, and paste in Terminal), and press <Return>:
    defaults write com.apple.mail UserHeaders '{"Reply-To" = "[email protected]";}'
    The following article contains a more thorough description of this technique that takes into consideration the possibility that you might inadvertently overwrite other default headers by doing that:
    How to Add a Reply-To Header to All Emails You Send in Mac OS X Mail

  • Registered with incorrect date of birth when first turn iPad on

    Hi please help, I registered with the incorrect date of birth when first turned on the iPad, and now when I try to register to set up a iPad account the systems keeps saying can't register as date of birth does not meet age requirement even though putting in the correct dob. Please advise how can I change the original set up dob details. Thanks

    Read this for the instructions.
    http://www.ehow.com/how_8493711_change-birth-date-itunes.html

  • IDoc with incorrect data is expected to fail but it  does not

    Hi All,
    The Job CQM_CR_O_IF103_IN_INOVIS_ORDER3 got cancelled as result of a short dump. In the initial investigation we found that the IDoc 0000000012089824 had an incorrect information i.e. it had a material which did not
    exist. The IDoc is expected to fail and give an error message but has not done so.
    We also observed the IDoc does not fail when the incorrect materialhappens to be the last material in the IDoc.
    The workaround was to fail the IDoc manually and then the subsequent jobs runs successfully.
    Would like to know why the IDoc is not failing when it has incorrect
    data.
    Thanks & Regards,

    Hello,
    the idoc fails only if there is a hard error in the segment, means i.e. if there is a wrong transaction type or missing ... But I think that the system behavior is correct, because the idoc cannot fail because a product is "just" wrong. This is no hard error, you should then get an error in the transaction that i.e. the product does not exists. You can try to use badi CRMXIF_ORDER_MAP to check the products, but then please make sure that note 1644057 is implemented.
    BR
    Rene

  • IDoc with incorrect data is expected to fail but does not

    Hi All,
    The Job CQM_CR_O_IF103_IN_INOVIS_ORDER3 got cancelled as result of a short dump. In the initial investigation we found that the IDoc 0000000012089824 had an incorrect information i.e. it had a material which did not
    exist. The IDoc is expected to fail and give an error message but has not done so.
    We also observed the IDoc does not fail when the incorrect materialhappens to be the last material in the IDoc.
    The workaround was to fail the IDoc manually and then the subsequent jobs runs successfully.
    Would like to know why the IDoc is not failing when it has incorrect
    data.
    Thanks & Regards,

    Hello,
    the idoc fails only if there is a hard error in the segment, means i.e. if there is a wrong transaction type or missing ... But I think that the system behavior is correct, because the idoc cannot fail because a product is "just" wrong. This is no hard error, you should then get an error in the transaction that i.e. the product does not exists. You can try to use badi CRMXIF_ORDER_MAP to check the products, but then please make sure that note 1644057 is implemented.
    BR
    Rene

  • USB DAQ with ARM controller boards

    Hello,
         I wish to use USB DAQ (for example USB6509) with ARM or CORTEX-M3 board. I recently purchased one cortex - M3 (by luminary micro) from NI with labview embedded software. I wish to control and monitor large number digital I/Os using USB6509 but the controller card i wish to use is cortex-m3 boards. 
    can some one tell me is it possible at all? if yes, how to go about this? 
    thanks in advance
    Nabhi

    Hi Andy,
    There are a few interfaces that can be used depending on the data you want to send.
    If you want to use Wifi then dongles will be difficult as you would have to write a USB driver for this.  The simplest method would be to use a WiFi ethernet access point to put it on the network.
    If you are looking at general wireless technologies there is quite a lot based on serial technologies.  If you look at http://www.active-robots.com/products/radio-solutions/index.shtml there is a lot based on RS-232 which is available on the ARM7 board.  You may also find some that are based on UART ports, SPI or I2C that should be able to connect.
    I also wanted to draw your attention towards the SingleBoardRIO. It offers the form factor but is much more powerful by allowing you alot of DIO and programmable FPGA.  This is a single board version of the CompactRIO which has the same features but is larger and heavier so depending on the project may not be suitable. Check out ni.com/singleboard and maybe get in touch with your local NI branch for more information.  The SBRIO will offer the same connectivity options as the ARM board with the WiFi access point the simplest way to connect.
    Cheers,
    James Mc
    ========
    CLA and cRIO Fanatic
    wiresmithtech.com/blog

  • VISA Read gets incorrect data from serial connection

    I am having difficulty using the VISA functions in LabVIEW to read data from a virtual COM port. Data is being sent from a serial to USB chip via a USB connection using OpenSDA drivers. I have a python program written to read from this chip as well, and it never has an issue. However, when trying to achieve the same read in LabVIEW I am running into the problem of getting incorrect data in the read buffer using the VISA Read function.
    I have a VISA Configure Serial Port function set up with a control to select the COM port that the device is plugged into. Baud rate is default at 9600. Termination char of my data is a newline, which is also default. Enable termination char is set to true. A VISA Open function follows this configuration, and then feeds the VISA Resource Name Out into a while loop where a VISA Read function displays the data in read buffer. Byte count for the VISA Read is set to 20 so I can read more of the erroneous datat, however actual data will only be 6-12 bytes. The while loop has a wait function, and no matter how much I slow down the readings I still get incorrect data (I have tried 20ms thru 1000ms). 
    The data I expect to receive in the read buffer from VISA Read is in the form of "0-255,0-255,0-255\n", like the following:
    51,93,31\n
    or
    51,193,128\n
    And occasionally I receive this data correctly, however I intermittently (sometimes every couple reads, sometimes a couple times in a row) get incorrect readings like this:
    51,1\n
    51,193739\n
    \n
    51,1933,191\n
    51,,193,196\n
    51,1933,252 
    51,203,116203,186\n
    Where it seems like the read data is truncated, missing characters, or has additional characters. Looking at these values, however, it seems like the read was done incorrectly because the bytes seem partially correct (51 is the first number even in incorrect reads).
    I have search but haven't found a similar issue and I am not sure what to try from here on. Any help is appreciated. Thanks!
    Attachments:
    Serial_Read_debugging.vi ‏13 KB

    The first thing is that none of the error clusters are connected so you could be getting errors that you are not seeing. Are you sure about the comm parameters? Finally, I have never had a lot of luck looking for termination characters. You might want to just capture data and append each read into one long string just to see if you are still seeing this strangeness.
    What sort of device is returning the data? How often does it spit out the data? How much distance is there between it and your computer? Can you configure it append something like a checksum or crc to the data?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • Also unable to run project.. missing main.html?

    Screenshot of error dialog attached. Any suggestions? All I did was open an AI file and ran project. Thanks, Mark

  • QuickTime video in standalone app

    Hi, I've noticed that I can publish Director desktop apps that play Flash content with no player required on the user's comp. Is this the same with QuickTime video? Or do the users need to install QuickTime player. If so, what QuickTime version does

  • Contacts lost all data suddenly.

    My Contacts lost all data suddenly today. I upgraded to 10.8.2 this afternoon. Could that have caused it?  Can I do to retrieve my data?

  • Where can I get it repair

    I have a Creative Microphoto MP3. The only way you can hear music is by holding the top of it down. So I know there is a bad connection somewhere. Does anyone know where in the Dallas area, that I can take it and get it repaired?

  • Merging Multiple Files

    Hello, I have two folders with PDF files that I want to merge.  Both folders have files with identical file names.  I want Adobe to merge the two files if they have the same file name, and then save the merged file in a separate folder.  I need to do