Shop OBEX P1 Docs P2 Docs Learn Events
what am I doing wrong? probably something simple/stupid — Parallax Forums

what am I doing wrong? probably something simple/stupid

Bobb FwedBobb Fwed Posts: 1,119
edited 2010-07-28 06:31 in Propeller 1
I have a simple program that checks the temperature and turns on a relay based on the value.
i am having problems with an interface of buttons. Between temperature checks the software watches four buttons. It checks them more than 150 times each second, but it only seems to register one button press per second. What am I doing wrong. I know it is something simple, and a few extra pairs of eyes will help.

I am new to the oLED, is it just that taking so long to return an ACK before the program can move on?

Attached is the whole project. oled_program.spin is the main file.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!

Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!

Comments

  • bill190bill190 Posts: 769
    edited 2010-07-28 04:10
    I don't have time to look through your program, but with a brief glance I don't see any COGNEW's there.

    One advantage of the propeller is it has 8 processors. You can assign one processor to *just* look at the buttons full time!

    So might want to think about doing that.

    Then another thing which is helpful is to "see" what is going on. Perhaps connect LED's and turn them on/off with each button press to verify the program is "seeing" the button press.

    A typical problem is the processor is busy doing something else and is not looking at the button the moment you press it (can only do one thing at a time)...
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-07-28 04:43
    Thanks for the feedback, but I am well aware of that. There are up to three cogs being used at once in my program (one of my simpler programs), and one cognew (right at the top). I think the problem may be a driver/oLED issue because the cognew I use at the top is to make sure the the initialization of the oLED doesn't fail, it's pretty lame, because if it fails the cog just halts waiting for the ACK from the oLED.

    I have been using the debuging method to test if the prop is seeing the buttons, it is, but once it sees it, it appears to stop looking until the next cycle/second. The only obvious thing would be, I have a simple mistake in the timing or logic, or the driver is just taking that long to return back to the loop. That is something I can test tomorrow, to see how long the driver takes to return once called.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • T ChapT Chap Posts: 4,223
    edited 2010-07-28 06:31
    Bobb, what I do when trying to chase down strange issues that don't add up, is to take a piezo or other small speaker, use the piezo object and place a very short beep somewhere in the code, or in various places to indicate where the code is. Using different frequencies for the beeps as well as different durations allows for the beeps to be placed in a number of places but easily picked out as to where the code is.
Sign In or Register to comment.