Rsout does not work on Tx pin of the 18F25k22 but Hrsout does?


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    234
    Thumbs Up
    Received: 6
    Given: 39
    Total Downloaded
    11.61 GB

    0 Not allowed!

    Default Rsout does not work on Tx pin of the 18F25k22 but Hrsout does?

    Hello all,

    I have tested my circuit Tx output with Hrsout and it is all fine but Hrsout mode cannot be changed (I believe), it is always inverted.In order to have the Rsout_Mode facility I commented the Hrsout declarations and replace Rsout by the declaration below pointing the serial output to the Tx pin(17) of the 18F25k22 by the following declaration:


    'Rsout declares

    Declare RsOut_Pin PORTC.6 'which is the
    EUSART Tx asynchronous transmit for Hrsout p(in 17)

    Declare RsOut_Mode 1 'Inverted or True/False or 1, 0
    Declare Serial_Baud 9600 '0 to 65535 bps (Baud)
    Declare RsOut_Pace 50 '0 to 65535 microseconds (us)

    Checkingwith the oscilloscope I don't see the usual serial signal using a very simple test program but when I revert Hrsout it is back. My question is the Pic Eusart is in the way and how can I disable it? I suspect it is on the chip configuration where we should be able to disable the Eusart. My chip configuration is as below:

    Device = 18F25K22
    ;-------------------------------------------------------------------------------
    Declare Xtal = 16
    All_Digital = TRUE
    Declare Optimiser_Level = 2
    Declare Dead_Code_Remove = 1
    Declare Reminders Off
    Declare Show_system_variables = On

    OSCCON = %01000000
    Config_Start
    FOSC = HSMP ;EC oscillator (medium power, 500 kHz-16 MHz)
    PLLCFG = OFF ;Oscillator used directly
    PRICLKEN = On ;Primary clock enabled
    FCMEN = OFF ;Fail-Safe Clock Monitor disabled
    IESO = OFF ;Oscillator Switchover mode disabled
    PWRTEN = OFF ;Power up timer disabled
    BOREN = SBORDIS ;Brown-out Reset enabled in hardware only (SBOREN is disabled)
    BORV = 190 ;VBOR set to 1.90 V nominal
    WDTEN = Off ;WDT is always enabled. SWDTEN bit has no effect
    WDTPS = 32768 ;1:32768
    CCP2MX = PORTC1 ;CCP2 input/output is multiplexed with RC1
    PBADEN = On ;PORTB<5:0> pins are configured as analog input channels on Reset
    CCP3MX = PORTB5 ;P3A/CCP3 input/output is multiplexed with RB5
    HFOFST = On ;HFINTOSC output and ready status are not delayed by the oscillator stable status
    T3CMX = PORTC0 ;T3CKI is on RC0
    P2BMX = PORTB5 ;P2B is on RB5
    MCLRE = EXTMCLR ;MCLR pin enabled, RE3 input pin disabled
    STVREN = On ;Stack full/underflow will cause Reset
    LVP = Off ;Single-Supply ICSP enabled if MCLRE is also 1
    XINST = OFF ;Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
    Debug = OFF ;Disabled
    Cp0 = OFF ;Block 0 (000800-001FFFh) not code-protected
    CP1 = OFF ;Block 1 (002000-003FFFh) not code-protected
    CP2 = OFF ;Block 2 (004000-005FFFh) not code-protected
    CP3 = OFF ;Block 3 (006000-007FFFh) not code-protected
    CPB = OFF ;Boot block (000000-0007FFh) not code-protected
    CPD = OFF ;Data EEPROM not code-protected
    WRT0 = OFF ;Block 0 (000800-001FFFh) not write-protected
    WRT1 = OFF ;Block 1 (002000-003FFFh) not write-protected
    WRT2 = OFF ;Block 2 (004000-005FFFh) not write-protected
    WRT3 = OFF ;Block 3 (006000-007FFFh) not write-protected
    WRTC = OFF ;Configuration registers (300000-3000FFh) not write-protected
    WRTB = OFF ;Boot Block (000000-0007FFh) not write-protected
    WRTD = OFF ;Data EEPROM not write-protected
    EBTR0 = OFF ;Block 0 (000800-001FFFh) not protected from table reads executed in other blocks
    EBTR1 = OFF ;Block 1 (002000-003FFFh) not protected from table reads executed in other blocks
    EBTR2 = OFF ;Block 2 (004000-005FFFh) not protected from table reads executed in other blocks
    EBTR3 = OFF ;Block 3 (006000-007FFFh) not protected from table reads executed in other blocks
    EBTRB = OFF ;Boot Block (000000-0007FFh) not protected from table reads executed in other blocks
    Config_End
    '**** End of Fuse Configurator Settings ****

    Many tanks for your time.

    Regards,

    Yves






  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    542
    Thumbs Up
    Received: 61
    Given: 0
    Total Downloaded
    503.53 MB

    0 Not allowed!

    Default Re: Rsout does not work on Tx pin of the 18F25k22 but Hrsout does?

    ... my circuit Tx output with Hrsout and it is all fine but Hrsout mode cannot be changed (I believe), it is always inverted.
    Since you're using the 25K22 you're in luck. From the datasheet:
    The polarity of the transmit data can be controlled with the CKTXP bit of the BAUDCONx register.
    The default state of this bit is 0 which selects high true transmit idle and data bits.
    Setting the CKTXP bit to 1 will invert the transmit data resulting in low true idle and data bits.
    So, you can switch back to using the hardware USART and if you want to invert the TX data then set bit 4 (CKTXP) in the BAUDCON1 register.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    234
    Thumbs Up
    Received: 6
    Given: 39
    Total Downloaded
    11.61 GB

    0 Not allowed!

    Default Re: Rsout does not work on Tx pin of the 18F25k22 but Hrsout does?

    Thank you Tumbleweed for your time and prompt answer. I will definitely do that.

    Regards,

    Yves

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,712
    Thumbs Up
    Received: 364
    Given: 173
    Total Downloaded
    2.08 GB

    0 Not allowed!

    Default Re: Rsout does not work on Tx pin of the 18F25k22 but Hrsout does?

    It is only "some" of the recent devices that have allowed inverted or non-inverted output from a USART. I dare not add a directive for this because it will simply confuse users when the compiler reports that "it cannot do that on this device" :-)

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 1
    Last Post: 28th October 2019, 15:27
  2. [SOLVED !] How to connect LCD1602 data pin to random pin MCU?
    By Alexander in forum Proton Plus Compiler v3
    Replies: 20
    Last Post: 2nd April 2017, 09:54
  3. HRSout and RSout help or possible anomaly
    By joesaliba in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 8th July 2016, 10:16
  4. [SOLVED !] removing 28 pin SPDIP pictm - ? best way without re-work gun ?
    By Kapitan in forum The Lounge
    Replies: 18
    Last Post: 1st February 2012, 18:06
  5. Rsout - Hrsout
    By Richard in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 27th May 2006, 18:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts