Serout PIC16F628 to PC R18iXL Board


Closed Thread
Results 1 to 3 of 3
  1. #1
    Spindle's Avatar
    Spindle Guest

    Cool Serout PIC16F628 to PC R18iXL Board

    Hey guys and girls,

    I am trying to just print a string to the serial communicator in Microcode Studio. I purchased the Rapid18iXL board built from hobbyengineering.com but the company who makes them is www.dhmicro.com. This board has RS232 support. The documentation on it can be found... http://www.dhmicro.com/PDFs/Manual/Rapid18iXL_Man.pdf and http://www.dhmicro.com/PDFs/Appnote/..._SQ1_R18XL.pdf I have searched the forums for everything I could find on the serout command and I think my code is correct and its some hardware issue. Maybe my jumper configuration is wrong on the board? I am using a PIC16F628 microchip and BPB and the Epic Programmer. Here is my code..

    @ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' system clock options
    @ DEVICE pic16F628, WDT_ON ' watchdog timer
    @ DEVICE pic16F628, PWRT_ON ' power-on timer
    @ DEVICE pic16F628, MCLR_OFF ' master clear options (internal)
    @ DEVICE pic16F628, BOD_ON ' brown-out detect
    @ DEVICE pic16F628, LVP_OFF ' low-voltage programming
    @ DEVICE pic16F628, CPD_OFF ' data memory code Protect
    @ DEVICE pic16F628, PROTECT_OFF ' program code protection

    include "modedefs.bas"
    define OSC 20

    CMCON = 7
    TRISB.0 = 0
    PORTB.0 = 0

    print:
    Serout PORTB.0, N2400, ["gaby"] ' Send string
    pause 100 ' pause 1/10 sec
    Goto print ' Forever

    end


    All I got is a bunch of garbage on the serial communicator screen. I have tried all sorts of baud rates ture and inverted. On the board I have a wire going from RB0 to TxD and that's it. I am not sure what RTS or CTS is but do not think it's needed. There is also RxD but that is for recieving data. I have literally been working at this for the last 5 hours. Any help is greatly appreciated!

    Thanks,
    Matthew

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    the internal; oscillator is 4MHZ, by using the DEFINE OSC 20 you tell to PBP to use a 20MHZ oscillator... remove that line and you should be in business. depending if you're using the MAX232, use true mode T2400 in your SEROUT.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Spindle's Avatar
    Spindle Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks a lot mister_e it works. So I use True because of the MAX232 chip and it inverts it? The reason I put Define OSC 20 is because my chip is a 16F628-20/P so I assumed the internal clock was at 20mhz! Thanks for the simple fix!

    Matthew

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 21:58
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 17:46
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 18:11
  4. Replies: 4
    Last Post: - 7th September 2005, 15:11
  5. SRF04 Range Finder 16F628 R18iXL Board
    By Spindle in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th June 2005, 03:08

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