Hi Nick,
DEFINE OSC 8 with it running on the default 4MHz internal would definitely do it.
Hi Nick,
DEFINE OSC 8 with it running on the default 4MHz internal would definitely do it.
I made the changes to the oscillator configuration. I set up a I/O toggle with 100ms pause and I am seeing the correct timing of the test code. since the pause command derrives it's timing from the osc, I am assume it is running at 8Mhz. modified code below.
INCLUDE "Modedefs.Bas"
DEFINE OSC 8
@ DEVICE PIC12F683, MCLR_OFF,INTRC_OSC_NOCLKOUT,protect_off
DEFINE DEBUGIN_REG GPIO ' Set as software RX in
DEFINE DEBUG_BAUD 2400 ' Set bit rate
DEFINE DEBUGIN_BIT 0 ' Set GPIO bit 0
DEFINE DEBUGIN_MODE 1 ' Set Debugin mode: 0 = true, 1 = inverted
OSCCON = %01110001 ' set internal 8MHz
TRISIO = %00000001
ANSEL = %00000000
ADCON0 = 0
CMCON0 = 7 ' Disable comparator
VRCON = 0 ' CVreff = OFF
CCP1CON = %00001100 ' PWM mode
PR2 = 249 '
T2CON = %00000100 ' Start Timer2, Prescaller 1:1
Rudder VAR byte
Duty VAR WORD
PWM_ON CON %00001100
PWM_OFF CON 0
test:
GPIO.4 = 1
pause 100
GPIO.4 = 0
pause 100
goto test
OSCCON = %01110001 should get you running at 8MHz internal, but you might want to
change to DEFINE DEBUGIN_MODE 0 ' for true mode. Most IR modules idle high. Inverted
mode serial inputs should idle low.
Bruce, that did it. The debugin time out was being hosed by the pull up on the IR data out. Thanks for the help!!!!
Nick
Glad I could help. Wait until the new 8-pin 12F1822s' come out. Then you can use the
hardware USART to receive IR data in the background using DT_INTs....![]()
Bookmarks