element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog Temperature Sensor
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 19 Nov 2013 4:14 AM Date Created
  • Views 498 views
  • Likes 0 likes
  • Comments 1 comment
  • sleep_sensor
  • psoc4
  • smarter_life_challenge
  • smarter_life
Related
Recommended

Temperature Sensor

Former Member
Former Member
19 Nov 2013

Hello All,

 

I have been having good momentum in the past few weeks. I was able to get the FRAM I2C to work. You can see the example code below:

 

/********************************************
writeSample
- Writes one 16 bit (two byte) sample to FRAM
- Uses FRAM automatic incrementing
- Assumes that A1 and A0 lines are set to logic zero
********************************************/
void writeSample(uint32 addr, uint16 sample)
{
  uint8 slaveAddr = 0x50;
  uint8 pageBit = 0;
  uint8 msb = 0;
  uint8 lsb = 0;

  //Step 1: Break address into components, set the slave address
  pageBit = HI16(addr) & 1U;
  msb = HI8(LO16(addr));
  lsb = LO8(LO16(addr));
  slaveAddr |= pageBit;

  //Step 2: Write the slave address/page bit & address MSB/LSB to FRAM
  I2C_I2CMasterSendStart(slaveAddr, 0);
  I2C_I2CMasterWriteByte(msb);
  I2C_I2CMasterWriteByte(lsb);

  //Step 3: Write the MSB then LSB of the sample to FRAM
  I2C_I2CMasterWriteByte(HI8(sample));
  I2C_I2CMasterWriteByte(LO8(sample));
  I2C_I2CMasterSendStop();
}

 

I recently hit a stumbling block though. The amount of data transferred off of the FRAM is so large that my computer has difficulty processing all of the USB-UART data! I've been hoping to get around this by using a Python script with PySerial:

 

import sys

import csv

import serial

 

#Setup serial port

ser = serial.Serial(port='COM22', baudrate=115200, timeout=60)

 

#Read

myData = ser.readline()

ser.close()  

 

So far, this has kind of been working. I will need to determine how I can get around this stumbling block. I hope to have a more interesting blog post next time with some sleep data.

  • Sign in to reply
  • vsluiter
    vsluiter over 11 years ago

    Hello Alex,

    One question, two hints:

    * I thought you would like to use a very low power solution. How are you going to combine that with sending so much data that your computer is getting into trouble?

    * I've recently used RealTerm quite a lot, it can log (store) the data that's coming through on the serial port. Sometimes helps.

    * If you're inserting code, please use the ">>" button in the editor, there you can choose to insert C++ style code. It looks prettier, and reads easier!

     

    Good luck with your project!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube