rs232 with hardware USART


Closed Thread
Results 1 to 17 of 17

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    It seems we write our reply at the same time...

    As i experiment when Picbasic Pro is use, you don't really need to define them by any TRIS stuff. In many case you can use the same i/o pin for getting entry from push button and out to a led without any TRIS define


    And you write this for PIC16F876

    TRISC.6 = 1
    TRISC.7 = 0

    but PORTC.6 is for trasmit, so output... must be set to 0
    and PORTC.7 is for receive....................must be set to 1

    oops

    regards
    Last edited by mister_e; - 14th October 2004 at 01:51.
    Steve

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

  2. #2
    shadowlight69's Avatar
    shadowlight69 Guest


    Did you find this post helpful? Yes | No

    Question Re: rs232 with hardware USART

    hi.
    I just used the below code on a pic18f4550 with max232 chip, running a 20mhz crystal, and i am getting no communication at all in either direction

    I have no clue what could be wrong. i tried anouther brand new ic, but to no avail.
    I also read the pbp manual and couldn't find the answer there.
    It would be very kewl to get this working.

    Thanks.

    Device = 18F4550
    Xtal 20
    DEFINE HSER_BAUD 9600
    TRISB.6 = 0
    TRISB.7 = 1
    DEFINE HSER_ CLROERR 1
    datain var Byte
    main:
    HSerIn [datain]
    HSerOut [datain]
    GoTo main
    End

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: rs232 with hardware USART

    Shadowlight69
    I'm also facing the same issue (and have been stuck for weeks now). The main issue (so far as I can understand) is that the processor timing is more complicated with this family of chips. The processor in your case is probably not running at 20MHz. The way to tell is to set a loop to flash an LED with a longish pause between flashes (say "pause 5000" for instance) and see how long it actually takes to flash. If it is not 5 seconds then your processor is not running at 20 MHz. My problem is trying to figure out from the fuses what the processor IS running at.

    Can I ask you to start this as a new thread? We'll get help quicker that way.

    Thanks,
    DD.

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: rs232 with hardware USART

    shadowlight69 , Is that the actual program you are trying to run? If so "Xtal 20" is not a command but, "DEFINE OSC 20" is.

    Dave Purola,
    N8NTA

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: rs232 with hardware USART

    Just a reminder: Hardware serial port USART in PICs require a pull UP resistor to work as they send Data TRUE.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: rs232 with hardware USART

    Joe S. , What? "Hardware serial port USART in PICs require a pull UP resistor to work " I have never heard of such a thing.. The USART port's on all of the MicroChip processors are capable of sinking as well as sourcing current... At least the last time I read them.... Better read your data sheet's Joe.

    Dave Purola,
    N8NTA

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: rs232 with hardware USART

    Data TRUE idles high, Data inverted idles Low - Hserin receives data TRUE. Hardware usart receive is an input. It neither sources or sinks current, although there may be chips with internal pullups. I know the chips I have used will not receive without the pullup.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. RS232 comm
    By longdw in forum Serial
    Replies: 9
    Last Post: - 15th September 2009, 03:13
  2. Benefits of hardware usart over software?
    By sccoupe in forum Serial
    Replies: 2
    Last Post: - 19th March 2009, 01:16
  3. Replies: 6
    Last Post: - 31st August 2007, 09:31
  4. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  5. 16F628 Hardware USART problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 26th May 2004, 07:10

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