element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs All cleaned up and nowhere to go...
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jack.chaney56
  • Date Created: 15 Mar 2016 1:38 PM Date Created
  • Views 407 views
  • Likes 3 likes
  • Comments 3 comments
Related
Recommended

All cleaned up and nowhere to go...

jack.chaney56
jack.chaney56
15 Mar 2016

Simple holding place for the code to this point. Sort of a version management system if you think about it image.

I have tested the code here, and it does compile, and it does run on a 328P Arduino Nano (programmed with the 6pin programmer).

The code turns the Nano into a generic monitor,

basic mS timer,

8 A/D monitors, each with raw value and converted value via tables.

 

The raw A/D values are monitors 0-7, and are readable with SCPI monitor commands.

The converted values are monitors 8-15 and use the tables for the conversions.

three tables are used:

     table 0 is two sets of 8 switches. low 8 bits are active A/D channel 0-7, high 8 bits are sensor on bits 0-7 (inverted logic, 1=off or inactive)

     table 1 provides default sensor values 0-7 when A/D is active but sensor is off

     table 2 is 8 8x1 tables to provide conversions for A/D sensor values

 

Tables exist in EEPROM which is cleared to all 1s on new devices.

 

SCPI commands are available to update table information and read monitor values.

 

CONF:TABL

Configure table information.  Used to select and load contents into a table, or modify cells in a table.  Tables are always N x N structure. Parameters required for instruction.

Table number,  Update type (0=cell, 1=row, 2=block), Other parameters - for cell; X,Y,data for row; Y,(data0,data1,...), for block; X,Y,W,H,(data0,data1,...)

 

FETC:TABL?

Fetch contents of last table configured. No parameters. Returns table number, table type, width, height, and the content data, rows bounded by parenthesis.

 

CONF:MONI

Configure monitor set. Select series of monitors to output. Parameters are a list of the enumerated monitors to output.

 

FETC:MONI?

Fetch monitors. Returns the number of monitors in the list, and two lists; first is the list of the selected monitors, second is a list of the monitor values.

 

Pleas feel free to ask me questions about any of this up to this point.  The next series will begin to cover use based on the tools presented here.

Attachments:
a2d.c.zip
eeprom.c.zip
4846.main.c.zip
monitor.c.zip
oneTime.c.zip
parser.c.zip
scpiMeasure.c.zip
scpiStatus.c.zip
tables.c.zip
tables.h.zip
timers.c.zip
types.h.zip
uart.c.zip
  • Sign in to reply

Top Comments

  • jack.chaney56
    jack.chaney56 over 7 years ago in reply to clem57 +1
    Hi Clem, The goal was to make a generic platform with low overhead out of the Nano (could also be an Uno). Now that I have the platform, I am planning to add some extensions to create an engine controller…
  • jack.chaney56
    jack.chaney56 over 7 years ago in reply to clem57

    Hi Clem,

    The goal was to make a generic platform with low overhead out of the Nano (could also be an Uno). Now that I have the platform, I am planning to add some extensions to create an engine controller for four cylinder Coil On Plug (COP) and direct injection fuel. Signals only, the electronics needs an extension board with IGBTs or something similar to handle the power for coils and solenoids.  I am told that the fuel management code I have created is satisfactory for diesel as well.  Should have the start of the ignition code in a couple of days.

     

    Jack

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 7 years ago

    I like what you have done jack.chaney56  Not sure what is next, but I can not wait too long. image

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jack.chaney56
    jack.chaney56 over 7 years ago

    Code above provides a 57600 bps, n, 8, 1 serial through the USB. Commands to try...

    *IDN?

         will print the identifier information for the device.

    CONF:TABL 1

    FETC:TABL?

         will print the content of table 1 which is an 8x1 array.  Since the calibration is not programmed, the values are all -1, but it gives a view of what the output format will look like.

    CONF:MONI 0,1,2,3,8,9,10

    FETC:MONI?

         will output the values of the first 4 A/Ds and since they are disabled by default should print 0 for the first 4 (A/D raw) and -1 for sensor values

     

    Should have included some examples before.  Sorry,

     

    Jack

    • 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 © 2023 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