Framing error if I disable transmitter after shift register is empty?


Closed Thread
Results 1 to 40 of 46

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172

    Default Re: Framing error if I disable transmitter after shift register is empty?

    IT'S THE DARN PIC !

    I swapped the coding between the 2 PICs, and PIC #1 now has a framing error every time it tries to disable the transmitter.

    Name:  Framing error f.png
Views: 6295
Size:  26.9 KB


    I'm going to swap it for another unit and see if that changes things.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680

    Default Re: Framing error if I disable transmitter after shift register is empty?

    when you disable the transmitter how are you setting the tx pin
    code ?
    Warning I'm not a teacher

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Quote Originally Posted by richard View Post
    when you disable the transmitter how are you setting the tx pin
    code ?
    I'm not doing anything to it. Should I?
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680

    Default Re: Framing error if I disable transmitter after shift register is empty?

    explain how disabling tx-module sets the pin to "tristate"
    Warning I'm not a teacher

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172

    Default Re: Framing error if I disable transmitter after shift register is empty?

    I'm not using tri-state yet, cause for now I have only two PICs talking, and they're not sharing any lines (but I will be the future, hence why I'd like to master enable/disable of transmitter).

    It's direct TX-to-RX and RX-to-TX with 1 set of 4K7 pull-ups.

    Right now it's only an exercise.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680

    Default Re: Framing error if I disable transmitter after shift register is empty?

    It's direct TX-to-RX and RX-to-TX with 1 set of 4K7 pull-ups.
    yet when tx is disabled the pin is hard driven to logic 0 , explain how disabling tx-module sets the pin to "tristate"
    Warning I'm not a teacher

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172

    Default Re: Framing error if I disable transmitter after shift register is empty?

    I'm not setting anything to tri-state, yet. Using TXSTA.5 = 1 / TXSTA.5 = 0 is just preparing myself for when I will use Usart pins in tri-state.

    I thought I could just turn Usart TX and RX on/off whenever I wanted (when nothing was in the buffer).

    Or was that a wrong assumption?
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172

    Default Re: Framing error if I disable transmitter after shift register is empty?

    Hmmm, I moved PIC #2 up in PIC #1 spot, and put in a new unit in PIC #2 spot.

    PIC#1 can now disable transmitter at will, YAY! So that confirms that there's nothing on the breadboard interfering with that PIC.

    New PIC #2 gets a framing error, but neither of the PICs freeze now (I put the blinky channel right under each PIC).

    Name:  Framing error g.png
Views: 6449
Size:  44.9 KB


    PIC#1:

    Code:
    Start:
        TXSTA.5 = 1                     ' TXEN: Transmit Enable bit
        hserout [   "[1]"    ]                             
        while TXSTA.1 = 0               ' Check TRMT: Transmit Shift Register Status bit
        wend
        TXSTA.5 = 0                     ' <----- Causes Framing error after last byte !
    
        hserin [ wait("["), STR RecvData\11\"]" ]
    
        TXSTA.5 = 1                     ' TXEN: Transmit Enable bit
        hserout [   "[2]"    ]                             
        while TXSTA.1 = 0               ' Check TRMT: Transmit Shift Register Status bit
        wend
        TXSTA.5 = 0                     ' <----- Causes Framing error after last byte !
    
    Mainloop:
        BlinkLED = 1
        BlinkLED = 0
        GOTO Mainloop
    end

    PIC #2:

    Code:
    @   INT_ENABLE   RX_INT
        goto Start
    
    ReceiveInterrupt:
        hserin [ wait("["), STR RecvData\11\"]" ]
        UsartFlag = 1
    @ INT_RETURN
    
    Start:
    
    Mainloop:
        LEDblink = 1
        if UsartFlag = 1 then
            TXSTA.5 = 1
            hserout [   "[0]"  ]                            
            while TXSTA.1 = 0              ' Check TRMT bit
            wend
            UsartFlag = 0
            TXSTA.5 = 0
        endif
        LEDblink = 0
        GOTO Mainloop
    end
    Might have a few ideas more ideas to try out...
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Trying to emulate shift register
    By RuudNL in forum General
    Replies: 0
    Last Post: - 17th March 2013, 19:57
  2. pic+shift register+lcd
    By eworld in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd October 2012, 05:11
  3. Long shift register
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th April 2009, 19:14
  4. Framing Error /w USART
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th February 2007, 01:34
  5. Replies: 15
    Last Post: - 30th January 2005, 03:58

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