Pic12f675


Closed Thread
Results 1 to 2 of 2

Thread: Pic12f675

  1. #1

    Default Pic12f675

    Can someone please give me a indication what i am do-ing wrong i am trying to get serial coms running on a PIC12 but keeps on getting garbage the idea is to build a small data logger one input, rs232 coms and a spi ram chip

    Code:
    DEFINE OSC          4
    
    DEFINE ADC_BITS     10  '10 BIT A/D CONVERSION RESULT
    DEFINE ADC_CLOCK    3   'INTERNAL A/D RC CLOCK
    DEFINE ADC_SAMPLEUS 50  'SET SAMPLE TIME IN MICROSECONDS
    adval0  VAR WORD		'Create adval0 to store result
    DATAH VAR BYTE
    DATAL VAR BYTE
    
    CMCON = 7               'TURN COMPARITORS OFF
    TRISIO = %000001        'Set GSIO 0 INPUTS, others to OUTPUT
    ANSEL = %00110001 	    'Set GSIO 0 TO ANALOG A/D IN W/Frc
    ADCON0.7 = 1	        'Right Justify for 10-bit
    
    DEFINE DEBUG_REG GPIO          'Set Debug pin port
    DEFINE DEBUG_BIT 2             'Set Debug pin bit
    DEFINE DEBUG_BAUD 4800         'Set Debug baud rate
    DEFINE DEBUG_MODE 1            'Set Debug mode: 0=true,1=inverted
    
    DEFINE DEBUGIN_REG GPIO          'Set Debugin pin por
    DEFINE DEBUGIN_BIT 1             'Set Debugin pin bit
    DEFINE DEBUGIN_BAUD 4800         'Set Debugin baud rate
    DEFINE DEBUGIN_MODE 1            'Set Debugin mode: 0=true,1=inverted
    
    START:
    	TOGGLE GPIO.4
        PAUSE 1000
        DEBUG "D"
        
    GoTo START
    
    End

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

    Default

    This will probably help.
    Code:
    DEFINE OSCCAL_1K 1
    But running RS232 from a 12F675's internal oscillator may not be a good idea.
    Those old 4mhz internals aren't very accurate. Especially when the temperature changes.

    The 12F683's have the newer precision 8Mhz internals.
    Much better for serial.

    DT

Similar Threads

  1. PIC12F675 problem with port 5
    By NL2TTL in forum mel PIC BASIC
    Replies: 2
    Last Post: - 5th June 2009, 01:23
  2. SMS with pic12f675 using Serout
    By camilen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th June 2008, 20:16
  3. SERIN with a PIC12F675
    By ewandeur in forum Serial
    Replies: 4
    Last Post: - 30th July 2007, 15:04
  4. PIC12F675 trouble
    By russman613 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th February 2006, 18:40
  5. Erratic PIC12F675 behavior
    By russman613 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th February 2006, 14:46

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts