PDA

View Full Version : PIC 16F877 programming help



the_piculiar
- 18th July 2005, 19:47
Greetings All!

I am currently working on a piece of code where i want to send an output to a serial port of a PC using the SEROUT command and setting the BAUD rate. The major fallback is that i am new with this, and i lack PIC BASIC PRO manuals and internet time to research the use of these commands.

The idea: 5 sensors/switches are inputs to the 16f877. When one of these are HIGH, a 1 is outputed to the serial port of the PC.

I would greatly appreciate it if anyone will be willing to aid me writing this code.

Regards...The PICuliar

Art
- 18th July 2005, 21:50
'too easy
trisb = 1 ' portb is input
Check_Port:
IF portb <> 0 THEN 'check portb
serout porta.0,mode,["1"] 'conditionaly send byte
goto Check_Port 'do it forever

'Cheers, Art.

NavMicroSystems
- 18th July 2005, 22:39
Looks like here is the next attendee of that (http://www.picbasic.co.uk/forum/showthread.php?t=2056) course

@piculiar

See Manual (http://www.microengineeringlabs.com/resources/pbpmanual/)

Well,
you lack the time to research,
we lack the time to do your homework.

You can find many examples if you spend a little time to search this forum.