writting code for a 16 X 16 Table


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2006
    Location
    Melbourne, Australia
    Posts
    25

    Default writting code for a 16 X 16 Table

    This is my 1st post so i hope i got the right spot
    i have PBP2.46

    working with a PIC16f877a
    having dificulties understanding the book on writting a table that is 16X16 see below

    0123456789012345
    1.......................
    2.......................
    3.......................
    4.......................
    5.......................
    6.......................
    7.......................
    8.......................
    9.......................
    0.......................
    1.......................
    2.......................
    3.......................
    4.......................
    5.......................

    all the spots will be placed with a linnear line of numbers ie 14.7,11.2,15.8 etc
    this project is for measuring the air/fuel ratio on a car and displaying on a lcd.

    any help would be great.

    Crazy Cooter
    IF ITS STOCK IT WONT ROCK

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Angry No use to "bomb" the forum

    FIRST ...

    PbP only works with INTEGERS !!!

    SECOND ...

    PbP Works with Words ... where's your problem, then ???

    THIRD ...

    A look to JAYCAR ( Australia ) products could show you THE gadget you look for ... already cooked ... and working ( ! )

    Alain
    Last edited by Acetronics2; - 30th November 2006 at 09:03.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CrazyCooter
    all the spots will be placed with a linear line of numbers ie 14.7,11.2,15.8 etc


    Quote Originally Posted by Acetronics
    ...
    PbP only works with INTEGERS !!!
    ....

    As Alain said, integers would be your problem but, if you can say that your linear line of numbers will never get above 25.5 then you can get around it by storing the whole number by multiplication of 10.

    And read them back by dividing by 10 (also a second division for remainder).


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



    -----------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Hi,
    What is the maximum value that you want to store in the table and how many decimals do you need/want?

    Is the table supposed to be in RAM, internal EEPROM, external EEPROM or program memory?

    As the guys said before, PBP works with integers only so you cant just store the value 14.7 but depending on the largest number you need to store there's probably a few ways around that.

    Then when you have your table, how will you access it? By row/column or....?

    /Henrik Olsson.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    And probably going to use a standard 3 wire O2 sensor, narrowband thing.
    Not going to work...
    JDG

  6. #6
    Join Date
    Nov 2006
    Location
    Melbourne, Australia
    Posts
    25


    Did you find this post helpful? Yes | No

    Smile Custom Fuel injected Rideon

    Thanks to everyone that responded. Its been great.

    This project is for a fuel injected rideon. i have compleded an analogue circuit and it works ok. but i am not 100% happy with it. the o2 sensor is sensing if the engine is rich or lean. the pic's (16f877a @ 20MhZ) job is to make sure it stays correct at 14.7 with injecting the correct amount of fuel at its given RPM / LOAD thats why i am needing a table.

    The max rpm the engine will do is 3600

    Is there any way to make the table bigger than 16 X 16
    ie 64 X 64?


    thanking all in advance
    IF ITS STOCK IT WONT ROCK

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes, use an external EEPROM or use a variant of 'Embedded string in your CodeSpace' thread
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    And again, you do realize that a regular 2 wire O2 sensor doesn't tell you what your A/F ratio is, it just tells you if you're running rich or lean. And it only tells you that if let it switch between rich and lean.
    The ECM's don't try to maintain an exact .5v from the O2 sensor (that's practically impossible), they run the engine just a bit leaner, wait for the O2 sensor voltage to drop, then run it a bit richer, wait for the O2 sensor to rise, the start the process over again. They call it 'O2 sensor crosscounts'. On normal engines (well, ok, mine for example, '01 Dodge Ram), I measure around 30 cross counts, which means 30 times second, my truck's computer has recognized that the O2 sensor has swung lean, so it richens up the mixture, then it see the O2 sensor swing rich, so it lean out the mixture.

    See that?

    Do a Google search for 'MegaSquirt' do-it-yourself fuel injection system, you'll see what I mean by all this.

    JDG

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 09:02
  2. PC Scan Code Table
    By Melanie in forum Documentation
    Replies: 1
    Last Post: - 18th November 2009, 19:36
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Embedded Strings in your Code Space
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 9th March 2008, 07:50

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts