• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MLRC question

Status
Not open for further replies.

wejos

Member
what happens if i will leave out the MLRC part of the circuit (dont include the 20k resistor and the 472 ceramic), you think it will still function?


and i have noticed also that some projects use 1k resistor between the (say) RB0 and LED, some projects do not esp on the RC ones. should i also?
 
Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
what happens if i will leave out the MLRC part of the circuit (dont include the 20k resistor and the 472 ceramic), you think it will still function?


and i have noticed also that some projects use 1k resistor between the (say) RB0 and LED, some projects do not esp on the RC ones. should i also?
hi,
It depends upon how you have assigned the MCLR pin in the CONFIG of your program.

Whats the PIC type.?
 

wejos

Member
PIC is 16f84A. here's the schematic and im using it for serial communication.

 
Last edited:

wejos

Member
heres the code and ive simulatide this and worked.

Code:
LIST	p=16F84		;tell assembler what chip we are using
	include "P16F84.inc"		;include the defaults for the chip
	ERRORLEVEL	0,	-302	;suppress bank selection messages
	__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC ;sets the configuration settings (oscillator type etc.) or RC_OSC if thats what your using




Rcv_Byte     equ    0x0C     
Bit_cntr     equ    0x1C
Delay_Count  equ    0x0D
STATUS	     equ	0x03	
PORTA	     equ	0x05	
PORTB	     equ	0x06	
TRISA	     equ	0x85	
TRISB	     equ	0x86	

org	0x000
           
Initialise	CLRF	PORTA
	        CLRF	PORTB
	        BSF     STATUS,5    	
	        MOVLW   b'00000000' 
            MOVWF   PORTB       
	        BCF     STATUS,5    
    		CALL	SER_INIT    
Loop		CALL	Rcv_RS232
	    	MOVWF	PORTB       
            goto	Loop


SER_INIT
            BSF     STATUS,5        
            MOVLW   b'00000001'
            MOVWF   PORTA
            BCF     STATUS,5         
            RETURN


Rcv_RS232   BTFSC   PORTA, 0x00     
            GOTO    Rcv_RS232
            CALL    Start_Delay	    
            BTFSC   PORTA,0x00      
            GOTO    Rcv_RS232
            MOVLW   0x08            
            MOVWF   Bit_cntr
            CLRF    Rcv_Byte
Next_RcvBit CALL    Bit_Delay
            BTFSS   PORTA,0x00
            BCF     STATUS,C
            BTFSC   PORTA,0x00
            BSF     STATUS,C
            RRF     Rcv_Byte,f
            DECFSZ  Bit_cntr,f      
            GOTO    Next_RcvBit
            CALL    Bit_Delay
            MOVF    Rcv_Byte,W
            RETURN

Start_Delay MOVLW   0x0C
            MOVWF   Delay_Count
Start_Wait  NOP
            DECFSZ  Delay_Count,f
            GOTO    Start_Wait
            RETURN

Bit_Delay   MOVLW   0x18
            MOVWF   Delay_Count
Bit_Wait    NOP
            DECFSZ  Delay_Count,f
            GOTO    Bit_Wait
            RETURN

end
 

blueroomelectronics

Well-Known Member
The 10pf caps on the crystal may be a little low. 22pf is a better choice. Also you'll need 0.1uf caps near the VSS & VDD on the PIC
I've avoided the cap on MCLR as it can mess up ICD programming.
 

smanches

New Member
Probably not, but it will probably randomly reset on you. The resistor MUST be there for this to not happen. Reset pins should never be left floating.

Why do you want to leave it out?
 
Last edited:

wejos

Member
Probably not, but it will probably randomly reset on you. The resistor MUST be there for this to not happen. Reset pins should never be left floating.

Why do you want to leave it out?
k fair enough. so thats the purpose of this resistor and cap.
 

wejos

Member
i bought the .1 uf 50v caps for the decoupling but it's electrolytic. should i follow the polarity when i mounted it? i have a spare .47 uf 50v caps can i use this also to decouple the rs232? im kind of short of caps. thank you.
 

ericgibbs

Well-Known Member
Most Helpful Member
i bought the .1 uf 50v caps for the decoupling but it's electrolytic. should i follow the polarity when i mounted it? i have a spare .47 uf 50v caps can i use this also to decouple the rs232? im kind of short of caps. thank you.
The 100nF will be OK, neg term to 0V

470nF for the RS232 are a bit small, but they should work OK.
 

wejos

Member
ty eric. i shared the decoupling cap to both the PIC and RS232 and still worked.

I'll try use the 470nf for the MAX also.

wow! 9600 is fast.

thank you guys for everything.
 

millwood

Banned
neither the cap nor the resistor is needed: they form a low pass filter to improve resistance to random interference, and the cap holds the mlrc pin low briefly during power on.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top