PDA

View Full Version : 12f675 Serout Int_Osc problem



RFsolution
- 29th April 2007, 22:10
Hi all ,

I'm suffering in converting a working code from a 16f628 to a 12f675

I noticed a problem in the serial communication during debug

Can anyone help me with configuring the fuses for this device

I have:

GPIO.0 as 10bit ADC
GPIO.1 & GPIO.2 as output
GPIO.3 RXD
GPIO.4 TXD both inverted driven direct to a com port via resistors
GPIO.5 input

This is the start of the code where i want to test serout but i got
rubbish


@ DEVICE INTRC_OSC_NOCLKOUT
@ DEVICE MCLR_OFF

DEFINE OSC 4
DEFINE adc_bits 10
DEFINE adc_clock 3
DEFINE adc_sampleus 50
CMCON = 7 'TURN COMPARITORS OFF
TRISIO = %101001 ' Set GPIO 0,3 & 5 TO INPUTS, others to OUTPUT
ANSEL = %00110001 ' Set GSIO 0 TO ANALOG A/D IN W/Frc
ADCON0.7 = 1 ' Right Justify for 10-bit

TXD var gpio.4
RXD var GPIO.3
adcresult VAR WORD
dummy var word



test:

SerOut txd,5,["Serial test",10,13]
pause 500
goto test

skimask
- 30th April 2007, 03:11
Hi all ,
This is the start of the code where i want to test serout but i got
rubbish
@ DEVICE INTRC_OSC_NOCLKOUT


Is your internal 4Mhz clock actually running at 4Mhz or is it running off frequency?

mister_e
- 30th April 2007, 05:28
maybe Define OSCCAL_1k 1 could help, Software calibration could be done ... but.. serial com and int osc are poor bedfellow.

RFsolution
- 30th April 2007, 09:39
Thanks SKymask and ofcourse Mister-E (the forum reference hihihi)

Well i tried even 1200bd without succes

I will add the Osc-Cal define this evening and give it a try

Thanks