Shop OBEX P1 Docs P2 Docs Learn Events
Bs2 & lcd problem — Parallax Forums

Bs2 & lcd problem

sport270sport270 Posts: 82
edited 2014-12-05 07:06 in BASIC Stamp
I've got some issues with a program I'm running on a bs2 that displays hz on a 2x16 back lit serial lcd. On a couple of them the lcd seems to shut off, from thermal overload of the 7805 to the lcd. But the one I'm working on right now in the field, it seems the bs2 is shutting down, because the lcd is still showing back light on, just no characters... One other problem is that I have the bs2 counting pulses on a shaft for 1/2 second then *2 to get the correct speed. Problem is that when it gets to 650ish.... it starts back over to 1 and keeps rising as the speed increases. It should be showing in the 720 range and I also have a low speed alarm monitoring it. So the user has to set the alarm at like 5 -10 instead of like 670.... not sure why it won't display over 650 but wondering if that problem could be resetting or locking up the bs2

Comments

  • sport270sport270 Posts: 82
    edited 2014-12-04 05:56
    I guess my first option should be to try freqin and see if that makes a change instead of count. ...?
  • stamptrolstamptrol Posts: 1,731
    edited 2014-12-04 06:09
    Based on the COUNT description in the manual, you should be OK up to 120 KHz. However, that assumes a clean square wave and a minimum pulse width of 4+ uSec. What are you using to generate the shaft pulses?

    But you're only getting 300 or so in the 1/2 sec period, so that should be fine. It almost sounds like your variable is a byte when it should be a word.

    Cheers,
  • sport270sport270 Posts: 82
    edited 2014-12-04 06:22
    Checked and it's listed as a WORD ..
    The sensor is a mag pickup coil that faces a 37tooth gear.
    I take the .5 sec reading and *162 then /100 to get it into hz/rpm then *2 to get correction to full second reading.
  • davejamesdavejames Posts: 4,047
    edited 2014-12-04 08:39
    sport - can you post the code and schematic of your application?
  • JonnyMacJonnyMac Posts: 9,157
    edited 2014-12-04 11:32
    I suggest you start by displaying the raw counts for the period when the gear is running max speed. Multiply this value by 162. If it is greater that 65535 you have a roll-over problem. If it does go over, but not by much, you could run for 333ms and then multiply by 3 later. Or 250 millisecond and multiply by 4.
    Checked and it's listed as a WORD ..
    The sensor is a mag pickup coil that faces a 37tooth gear.
    I take the .5 sec reading and *162 then /100 to get it into hz/rpm then *2 to get correction to full second reading.
  • sport270sport270 Posts: 82
    edited 2014-12-05 01:54
    just a thought….. if a 37 tooth gear was turning 700rpm it would show up as approx 430hz.. so i was *162 then /100 that would correct the hz reading into rpm…. but 430 *162 is 70,794 which puts it over the 65,535 limit
    would it not work to just take the 430 hz and first /100 then *162 to get to same corrected reading but not go past the over run limit…?
  • stamptrolstamptrol Posts: 1,731
    edited 2014-12-05 07:06
    Now that we have a likely suspect in the number getting too big, the effort is to keep it withing the 65535 limit.

    You are quite right that changing the order of manipulations will give generally the same solution as Jon's suggestion to just grab a smaller number by shortening the input window.

    Cheers,
Sign In or Register to comment.