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.

PIC16F84A(start bit and stop bit)

Status
Not open for further replies.

gg

Junior Member level 3
Joined
Jun 12, 2004
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
349
About the parallel-in-serial-out of PIC16F84A, how can i generate a start and stop bit??? I required the start and stop bit because i wanted to send the data into the computer through rs-232 cable.

Next question: I'm inputting various of binary data parallelly such as 10101,11000,10111 and so on into my PIC. From my shallow knowledge on PIC, i only know that the PIC can able read the input data by using BTFSC or BTFSS. By using this two instuctions, it can only compare the data inputted with the bit required in the PIC. I think all of you are blur on what i say, let me give an example:

START .....
BTFSS PORTA,0
GOTO START
carry on here

If bit 0 in portA is set to a 1, it will skip the GOTO instruction and continue with the next instructions.

I want my PIC to accept any binary data from PORTA and store temporarily in my register. How can i do that???
 

Since you know how to read the inputs from single pins, I'd assume you know how to output to a single pin too. The START bit is simply an output-low bit, and the STOP bit is simply an output-high bit. As I said before, bit-banging is just manipulating the bitwise output to be compliant to RS232 protocol. If you do not know what the protocol is, refer to **broken link removed**.
As for your second query, please refer to the Mid-Range Reference Manual downloadable off Microchip's website. Refer to the section titled Instruction Set. All the instructions are there, and you SHOULD be familiar with all of them if you want to do programming. In particular, the MOVF and MOVWF instructions will answer your question.
Lastly, RS232 comms has a baudrate associated with it. The bits have to be output at the specified baudrate. To achieve this, you can use simple NOP delays, or timer interrupts. Information on the NOP instruction could be found in the instruction set. For timer interrupts, read up the TIMER section on the manual. Have fun reading the manual!
There's bound to be ready-made bit-bang codes for PICs out there. Go search www.piclist.org for them.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top