PDA

View Full Version : MPLab IDE Project



BRINGERofBACON
- 29th April 2008, 08:14
howdy, i've just begun using MPLab and PIC programming and have no clue as to how i should go about doing this project. i understand what it wants me to do, i just can't come up with the code to do it.

im using the 16f84a device

basically i need to implement a serial to parallel converter with an RS-232 communications standard.

as i understand it, when a byte of data comes in (through the pin RA0), the start bit is detected. and then after delaying 1.5 periods, bit sampling occurs every period until all 8 bits are sampled. then i need to copy this parellel data to portb and set the 'DA' flag (which is assigned to pin RA1) to high when new data is available. the output needs to be double-buffered.

i have a basic outline of how things should be done, but how exactly do i code this?

thanks for any help

Ron Marcus
- 29th April 2008, 12:44
Use Serin to put a byte into 'var' ; If you don't use an RS232 level converter, you will need to do it with the Serin statement. Check the manual.

PortB = var
high PortA.0

skimask
- 29th April 2008, 13:59
Use Serin to put a byte into 'var' ; If you don't use an RS232 level converter, you will need to do it with the Serin statement. Check the manual.
PortB = var
high PortA.0
Doesn't say he's using PBP though...

Looks like another job for good ol' blinky LED first...

MarioC
- 1st May 2008, 06:38
I agree with RON MARCUS.

The PIC16F84A does not have a serial port, so you MUST use SERIN and/or SEROUT.


As stated by SKIMASK, you need to define which compiler you're using.


And on a personal note:
It appears you need homework done. I recommend reading the sample programs provided in the PBP folder.


PS: Forgive my english, it's a little rusty.

foss
- 3rd May 2008, 02:45
Using MPLab he is probably using MPASM. ?

foss

Darrel Taylor
- 3rd May 2008, 04:01
Or Perhaps, If we knew what kind of Bacon you were Bringing to the table?

<table><tr><td><img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2556&stc=1&d=1209780756" width=210 height=157 /></td><td><img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2557&stc=1&d=1209780756" width=210 height=157/></td></tr></table>

The one on the left could inspire me to write a whole program!

The one on the right... not so likely. :eek:
<br>

Ron Marcus
- 3rd May 2008, 12:09
This one does not require a separate power supply...