Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Rs232 in PIC16F84A with assembly code

Status
Not open for further replies.
Hi,

When I tried to simulate your code it gave some memory error messages.
I just removed the Calls for the LCD and the code runs fine as you can see form the screen shot.

As soon as the PC sends any character your Pic returns 'T'

Hope that helps.
 

Attachments

  • ScreenShot002.jpg
    ScreenShot002.jpg
    26.3 KB · Views: 88
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Hi
thanks dear wp100.I must try it.

---------- Post added at 11:21 ---------- Previous post was at 10:08 ----------

Hi
I try my code again.I did'nt use tinner Acid to clean my curciut.so it takes noises and didn't work.now I can transmit data from PC to PIC but I can't transmit data from PIC to PC.every thing is ok but it dosen't work!:-(
can u check my code plz? I use Serial Communication programe on Proton compiler.
 

Proton is like basic
I just use it's serial communication programme.
here is my transfer code:
SEROUT MOVWF RCV
MOVLW 0X08
MOVWF COUNTER
BCF PORTB,6
CALL DELAY104US
Sendbit RRF RCV,1
BTFSC STATUS,C
BSF PORTB,6
BTFSS STATUS,C
BCF PORTB,6
CALL DELAY104US
DECFSZ COUNTER,1
GOTO Sendbit
BSF PORTB,6
CALL DELAY104US
RETURN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DELAY ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DELAY52US ;;
movlw .33 ;;
movwf Reg_1 ;;
decfsz Reg_1,F ;;
goto $-1 ;;
nop ;;
NOP ;;
RETURN ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DELAY104US ;;
movlw .68 ;;
movwf Reg_1 ;;
decfsz Reg_1,F ;;
goto $-1 ;;
NOP ;;
RETURN ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

thanks

---------- Post added at 14:41 ---------- Previous post was at 13:46 ----------

Hi
every thing is ok.I can transmiting data from pic to pic and pic to pc! the problem was in wire connection on board
thanks every body specialy wp100;-)
 

Hi

can you help me to config inbuilt USART on PIC16F628A with 9600BPS speed?
thNKS
 

You can use Pic16f877a to communicate with your computer. It has a built-in UART module, or even ADC.

I am using MikroC Pro as my compiler. If you're interested, you can have my samples. Don't worry, those examples are so simple and they are all working.

Felipe
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Hi
I have work with MikroC.I didn't like that! I use just assembly.thanks
 

I found this UART test example in assembly recently:

UART test program for 16F628

The test program is fairly straight forward and uses the built-in USART of the 16F628, you may or may not have to modify it slightly for the 16F628A check the appropriate datasheet.

Also:

PIC16F628 UART trouble shooting

Unfortunately, I am not familiar with Proton.

BigDog

---------- Post added at 11:36 ---------- Previous post was at 11:18 ----------

Here's a handy UART Initialization Macro for the PIC16F series as well:
 
  • Like
Reactions: vishy71

    vishy71

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top