In SX Microcontrollers, SX/B Compiler and SX-Key Tool, jbechtel wrote: Thanks so much for the reply, So, What I'm really doing is a bit beyond the code example. I actually did try stretching out the original time value, and it didnt cause the receiver to respond The wacky part is that in order to get the 38khz at all I goosed the clock frequency way up to 38mhz, and use the value of 72400 ( by trial and error) to make the receiver wake up properly. I am using a freq meter as well... I'm transmitting to a BS2 ( for now , I want to do that ultimately with an sx as well) and using the modified example code below, I'm able to receive pulsein's on the bs2, as well as nice solid logic probe readings. The original example code wont wake up the receiver at all. My freq meter says the resulting frequency from the example code ( with a pulse time value of 200 ) is 174khz I did use the freq meter and some trial and error to get the values that will give me the 38khz below Could the compiler directives incorrect in some way? It seems the sx clock frequency isn't being scaled to the 38000 value in some way, which would affect the pulsin results I'll eventually be looking for on the sx I would guess. hmmmm, Thanks!!! JB ' ========================================================================= ' ' File...... FREQOUT.SXB MODIFIED ' Purpose... Object detection with IR ' Author.... (c) Parallax, Inc. -- All Rights Reserved ' E-mail.... support@parallax.com ' Started... ' Updated... 05 JUL 2006 ' ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Description ' ------------------------------------------------------------------------- ' ' Uses FREQOUT to modulate an IR LED for object detection. When object ' is detected, a tone is generated from the pieze element. ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSCXT2, TURBO, STACKX, OPTIONX FREQ 38_000_000 ID "IRTRANS" ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- 'IrLED VAR RB.0 ' output to IR LED 'Detect VAR RB.1 ' input from IR detector 'Spkr VAR RB.2 ' output to piezo 'irfreq var word ' ------------------------------------------------------------------------- ' Constants ' ------------------------------------------------------------------------- IrMod CON 72400 ' 38000000, 72400 modulation freq = 38 kHz '69725 = 36.74 '108090 = 56.7k ' 63250 = 33.3k '73200 = 38.42 ' ========================================================================= PROGRAM Start ' ========================================================================= ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: DO FREQOUT RB.0, 4, IrMod ' frame pulse @ 4ms pause 200 LOOP ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=278206#m278217 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)