Shop OBEX P1 Docs P2 Docs Learn Events
Piezospeaker buzzing when executing a program ; Line follower appkit — Parallax Forums

Piezospeaker buzzing when executing a program ; Line follower appkit

N0M4dICN0M4dIC Posts: 14
edited 2011-03-06 18:46 in BASIC Stamp
Hi everyone!
I recently bought a Line Follower Appkit for my Boe-Bot and installed it. (#28108)
It's working pretty well, but since I didn't wanted to use pin 4-7, I used pins 0-3 by simply modifying the registers from DIRB to DIRA, OUTB to OUTA and so on.

I have other components on pins 4 (piezo), 5 and 7 (pushbuttons).
When executing the program (Parallax original source code), the piezo keeps buzzing, which is very annoying.

1. Why does the pin 4 influenced by the A registers in the program?
2. How to stop that damn buzzing?

Parallax source code (line following example) here: http://www.parallax.com/Portals/0/Downloads/src/prod/FasterQtiSubroutineSource.zip

Thanks for helping!

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-06 13:21
    I'm confused by which outputs you're using. On the one hand, you said you changed DIRB to DIRA, etc.; but on the other hand, you say the piezo buzzes when you use Parallax's original code, which uses OUTB. Which is it?

    -Phil
  • N0M4dICN0M4dIC Posts: 14
    edited 2011-03-06 13:56
    I modified the original parallax source code. I modified the register commands to use pins 0-3.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-06 14:31
    Do you have the piezo pin set to an output at all tmes? If not, it could be picking up crosstalk from P3. If you don't want to keep it in an output state, you could reassign it to a pin further from P0-P3.

    -Phil
  • N0M4dICN0M4dIC Posts: 14
    edited 2011-03-06 14:45
    Crosstalk? How is that possible?

    I did not set any pin except 0-3.
    Also, I can hear the buzzing while I connected the piezo to pin 4, 5, 6 and 7, which would mean that theres something on the A and B register. I don't understand how it is possible.

    Thanks for your help anyway!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-06 15:13
    Crosstalk? How is that possible?
    A piezo is a very high-impedance device. If it's connected to a pin that's not being driven, it's possible to pick up noise from nearby pins through capacitive coupling. If it's producing any buzzing at all, it would be very faint, though. If it's louder than that, you've probably neglected to change one of the B's in the program to an A. (I count four places that need to be changed.)

    -Phil
  • N0M4dICN0M4dIC Posts: 14
    edited 2011-03-06 17:35
    Yep, I think that crosstalk is the problem. The sound is quite faint, but there is a lot of echo in my room, so I can hear it pretty well. I didn't know about that phenomenon, and it was driving me crazy.

    Thanks, I'll see what I can do about it. But, can't I just set the piezo pin to high while I'm not using it to avoid that crosstalk?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-06 18:46
    Yes, but I'd set it to low.

    -Phil
Sign In or Register to comment.