RS232 with 16F628 problem


Closed Thread
Results 1 to 8 of 8

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    i don't have any of those 4.XXX crystal here and that cause you timing problem... for sure since PBP don't know that specific speed. Easy way to solve the problem, use the internal 4mhz one wich you can select at the programing time or by setting the configuration fuse into your program.
    set configuration fuse into your program

    another way, let's calculate the right SPBRG value for your crystal. By using the formula in the datasheet use SPBRG=114 or 115 try both.
    Steve

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

  2. #2
    Join Date
    May 2005
    Posts
    49


    Did you find this post helpful? Yes | No

    Talking Yes it works :)

    SPBRG=114 is the correct number.How can u calculate the number 114?Can u teach me?Or is there any simple program that calculates that value?It really works good u help me soo much i really don't know how to thank u.
    Asking is not a shame but not learning is a SHAME!!!

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


    Did you find this post helpful? Yes | No

    Default

    Great!

    The way to calculate the SPBRG is in the datasheet. section 12.1 table 12-1

    I set BRGH=1 in the TXSTA value so you use

    BaudRate=Fosc/(16(x+1))

    few math mods later you get
    X=(Fosc/(BaudRate*16))-1

    now you can easily do you own VB calculator for that
    Steve

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

Similar Threads

  1. Strange problem with Serin/Serout on 16F628
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 22nd August 2008, 00:16
  2. Replies: 3
    Last Post: - 12th February 2007, 18:32
  3. Wavecom with 16F628 communication problem
    By ericbeaugiuet in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd June 2006, 11:05
  4. 16F628 problem
    By Brown in forum mel PIC BASIC
    Replies: 1
    Last Post: - 6th May 2005, 19:56
  5. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43

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