Serin woes - qualifiers not working


Results 1 to 12 of 12

Threaded View

  1. #9
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by tekart View Post
    Had a long chat with Charles at MElabs and he had me go over all the hardware and also try DEBUGIN. Still not recognizing the qualifier
    Hello Guy,

    Your code works for me, even with hex. (at least on my 12f683). But, I have to add this at the top of my code. Otherwise, I get no response.

    Code:
    CMCON0 = 7              'TURN COMPARITORS OFF
    ANSEL  = %00000000      'Set all pins to digital I/O
    ADCON0 = %00000000      'Analog converter OFF
    Here's what I used for my 12f683:
    Code:
    define OSC 8
    OSCCON = %01110000      'set for 8mhz internal
    CMCON0 = 7              'TURN COMPARITORS OFF
    ANSEL  = %00000000      'Set all pins to digital I/O *wont work without this *
    ADCON0 = %00000000      'Analog converter OFF 
    
    
    '*  uC      : PIC12F508                                         *
    '****************************************************************
    
    ' chip setup
    '	oscillator = INTRC
    '	watchdog = enabled
    '	MCLR = INPUT
    
    	X 	var 	byte			' dummy variable
    
    '	************** DEBUGIN SETUP ************
    	define debugin_bit 1		' incoming data bit
    	define debug_baud 9600		' baud
    	define debugin_mode 0		' 0 = true
    
    ' Pin Assignments
    	SCADAin		var gpio.1		' data in via MAX232
    	Ready		var gpio.2		' signal main processor to send data
                                    'I changed from gpio.4 to match my hardware
    	low ready	' set low
    
    ' config
    	TRISIO = %000010		' set I/O directions (0 = output, 1 = input)
    	'OPTION_REG = %01011111	' 12F508/9  bit 6 disables weak pull-ups
            OPTION_REG = %01000010	' for my 12f683
    
    Main:
    '	while scadain = 1 : wend	' test code detects presence of serial burst
    
    '	debugin 200,Noop,[wait(120)]	' wait for address and command
    	serin scadain,2,400,noop,[$0F]	' check for right qualifiers only
    
    	pause 10		' wait for serial burst to end
    	high Ready	' signal main processor to send current data
    	pause 2		' with a 2mS pulse
    	low ready
    
    	goto main
    	
    NoOp:
    	return
    Last edited by ScaleRobotics; - 2nd February 2010 at 17:19.

Similar Threads

  1. Serin timeout not working properly!
    By Megahertz in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 1st January 2010, 20:56
  2. Problem with PBP interrupt and Serin, please help
    By rgregor in forum mel PIC BASIC
    Replies: 0
    Last Post: - 22nd August 2006, 19:02
  3. Serin with low voltage
    By f_lez in forum General
    Replies: 3
    Last Post: - 21st August 2006, 11:52
  4. Serin woes
    By Libretto in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th November 2004, 09:45
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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