Shop OBEX P1 Docs P2 Docs Learn Events
Oscillator noise on squarewave output pin — Parallax Forums

Oscillator noise on squarewave output pin

ken261ken261 Posts: 4
edited 2011-05-06 15:37 in General Discussion
I am trying to develop a fixed data output source for a test set. As part of that source, I need a 10 kHz (approx) square wave CLK signal coming out. This was simple enough to create with interrupts, but I am getting oscillator noise on the square wave output.
I am using a 4 MHz Murata on the SX Tech dev board. There is no other circuitry added to the board, and I am reading the output on RA0. I get a steady 4 MHz signal (about 600mV) riding on the 5V output.

I have tried all the DEVICE OSC settings and it happens with the SX-Key as well. I also tried adding the 1Mohm resistor across the resonator, but that didn't change anything. I thought perhaps the chip was bad, but two other chips show the same thing. Unfortunately, I don't have another Tech board. For grins I changed everything to a 50 MHz resonator I had and ended up with a 50 MHz signal on the square wave. That at least tells me it's not coming from the SX28 internal clock.

I may try to breadboard the whole thing from scratch to see how that works. I've included the code just in case it's a simple setting error.

Thanks for any help.

Ken


'
' Device Settings
'
DEVICE SX28, OSCXT2, OPTIONX, STACKX, TURBO, BOR42
FREQ 4_000_000

'
' IO Pins
'

CLK PIN RA.0 OUTPUT ' square wave output

'
INTERRUPT NOPRESERVE 20_000
'
ISR_Start:
CLK = ~CLK ' toggle CLK around 10 kHz

RETURNINT

' =========================================================================
PROGRAM Start
' =========================================================================

Start:

LOW CLK ' assure startup state

Main:
pause 50
GOTO Main

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-05 18:47
    If it's really real OSC riding on the output, and it's a 10kc output, that should be easily filterable (LPF).

    Are you using the ground clip and thereby "coupling" noise in or are you using good 'scope method - a stub from the probe ground ring to the ground plane of your board?
    When you get picky, you have to be picky. I don't know your background, that's why I'm asking questions.
  • wasswass Posts: 151
    edited 2011-05-05 21:14
    There's a 10uf capacitor across the input of the voltage regulator and a 1.0uf capacitor after across the output of the voltage regulator (and a 0.1uf bypass capacitor across the SX chip socket). My guess is that one of these is bad, probably the 1.0 uf capacitor. This would cause the 5 volt supply to move up and down with the load from the SX chip (which, of course, is running a 4MHz).

    If you don't have a spare capacitor, try running the SX directly (not going thru the voltage regulator) using 3 AA (or AAA) cells in series at 4.5 volts.

    -Katie
  • ken261ken261 Posts: 4
    edited 2011-05-06 08:04
    Well, I've rebuilt the circuit on a breadboard and still get the noise on the output, so I guess it's not the Tech board. I've tried a couple grounding methods for scope measurements, but it's always there. :(

    I've thought about the LP filter, but I'm still curious why I'm seeing this in the first place. I had built a PWM circuit a year ago with this same Tech board and I don't think I saw the problem then.

    Thanks for your suggestions.
  • wasswass Posts: 151
    edited 2011-05-06 15:37
    What are you using for a power supply?
Sign In or Register to comment.