SEROUT Just Garbage!


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Can you post youre code!

  2. #2
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    I thought that was you that asked me for it. I emailed it to someone.
    Here it is I had added a led to it just to make sure the chip was actually working but here it is.

    Code:
    '12F675
    @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
    
    TRISIO.0 = 0   'Set GPIO.0 to output.
    ANSEL.0 = 0    'Set GPIO.0 to digital		
    GPIO.0 = 0
    CMCON = 7 ' PortA Digital inputs
    VRCON = 0        ' Voltage reference disabled
    OPTION_REG.7 =    0
    
    DEFINE OSCCAL_1K 1
    INCLUDE "modedefs.bas"
    
    
    led2 var GPIO.1
    
    loop:
    
    SerOut GPIO.0,N2400,["Hello World"]
    Pause 1000
    SerOut GPIO.0,N2400,["abc",13,10]
    Pause 4000
    
    high LED2
    pause 500
    LOW LED2
    pause 500
    high LED2
    pause 500
    LOW LED2
    pause 500
    GoTo loop

  3. #3
    Join Date
    Jan 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I Think your Oscal might be off or Lost!
    Try this code below to see.

    'Lost oscal recover program
    ' Use Hyper_Term settings "9600 N,8,1"
    '
    @ DEVICE pic12F675
    @ DEVICE pic12F675, INTRC_OSC_NOCLKOUT
    @ DEVICE pic12F675, WDT_OFF
    @ DEVICE pic12F675, MCLR_OFF
    @ DEVICE pic12F675, CPD_OFF
    @ DEVICE pic12F675, BOD_OFF
    @ DEVICE pic12F675, PWRT_ON
    @ DEVICE pic12F675, PROTECT_OFF
    SO VAR GPIO.0 ' serial out pin

    ANSEL = 0 ' disable converters
    CMCON = 7 ' disable comparators

    OSCCAL = 0 ' starting value

    Pause 2000

    loop:
    OSCCAL = OSCCAL + $10 ' increment calibration value
    SerOut2 SO,16468,[HEX2 OSCCAL, " This is a close OSC Value!",10,13] ' Display the hex value

    Pause 750 ' give time to read the value
    GoTo loop ' do it forever

  4. #4
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Ok I had to make a chane to get it to compile mine doesn't like how you did the defines but here it is
    @ __CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON & _CP_OFF & _CPD_OFF

    SO VAR GPIO.0 ' serial out pin

    ANSEL = 0 ' disable converters
    CMCON = 7 ' disable comparators

    OSCCAL = 0 ' starting value

    Pause 2000

    loop:
    OSCCAL = OSCCAL + $10 ' increment calibration value
    SerOut2 SO,16468,[HEX2 OSCCAL, " This is a close OSC Value!",10,13] ' Display the hex value

    Pause 750 ' give time to read the value
    GoTo loop ' do it forever

    I setup hyperterm with the settings you said and then set it to vt100 as well? its running now will let you know how it does.

  5. #5
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Also I should be using pin 2 on serial as the input? and pin 5 to ground?

  6. #6
    Join Date
    Jan 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    The Gpio.0 ---->1k resistor---->pin 2 on a DB9 "rxpin" --->computer

  7. #7
    Join Date
    Aug 2006
    Posts
    91


    Did you find this post helpful? Yes | No

    Default

    Ok cool I left it running for a while and got
    80
    90
    A0
    B0
    all close so how do I program that into the chip?
    I mean permanitly because I think I lost it on a number of chips when I very first started.
    Using Pic Kit 1 I don't see a way to manually set it.
    Last edited by geckogrotto; - 4th September 2006 at 03:47.

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  4. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 04:26
  5. Replies: 11
    Last Post: - 13th July 2005, 19:26

Members who have read this thread : 0

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