Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4793

12F1840 config issues

$
0
0
Hi All
I searched for an answer to this but came up blank. The program has been reduced to a single serout2 command to test. It works fine on both a 12F683 and 16F688 with the correct configs but I cant seem to get it to function on the 12F1840. There is data out but its garbage and clearly the wrong baud rate. I suspect I have not configured something, probably the oscillator correctly so requesting help. Its probably obvious but I cant spot it.
Cheers Pete

Code: PBP3
#CONFIG

__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _BOREN_OFF
__CONFIG _CONFIG2, _PLLEN_ON & _BORV_LO & _LVP_OFF

#ENDCONFIG

OPTION_REG = %10000001
WPUA = %00000000 'weak pull ups disabled
ANSELA = %00000000 'Select all digital
TRISA = %00001101 ' Make A0,A2,A3 inputs,A1,A4,A5 outputs

OSCCON = %11110000 'SET INTOSC TO 32MHZ
OSCTUNE = %00000000

INTCON = 0 'Latch out interrupt
CM1CON0 = 0 'disable comparators
FVRCON = 0 'Fixed voltage reference disabled


DEFINE OSC 32

Test:
serout2 PORTA.5,16468,["Testing",13,10]

pause 1000
goto Test

Viewing all articles
Browse latest Browse all 4793

Latest Images

Trending Articles



Latest Images