Truncated match.
PICList
Thread
'Beginner In Need Of Help - Again. How to Access P'
2000\01\10@010307
by
Ricardo F. Chung
Hello Everybody,
Well, thanks to the RTF from Tim Hamel
(http://pc-tek.hypermart.net/begin.rtf) I am well on my way with learning
about PIC programming. I am having one hitch though.
Could anyone say how the heck I access ports A and B? I am not entirely
clear on how and when to use the STATUS register to enable port access.
Is the access method for output the same as for input? Help. Thanks much.
Regards,
Ricardo F. Chung
Kingston, Jamaica
2000\01\10@012621
by
Tim Hamel
|
In a message dated 1/9/00 10:04:09 PM Pacific Standard Time,
spam_OUTrfchungTakeThisOuT
ANNGEL.COM.JM writes:
> Hello Everybody,
>
> Well, thanks to the RTF from Tim Hamel
Anytime =)
> (http://pc-tek.hypermart.net/begin.rtf) I am well on my way with learning
> about PIC programming. I am having one hitch though.
>
> Could anyone say how the heck I access ports A and B? I am not entirely
> clear on how and when to use the STATUS register to enable port access.
Port A and Port B are seperate memory addresses. Port A is at address 0x05
and Port B is at 0x06. In Port A's contents (I assume you're talking about
the 16F84), only 5 bits are used, 0 to 4. With Port B, all 8 bits are used.
Now, the STATUS register is for bank selecting, status bits, etc. Usually you
use bit 5 of the STATUS register to switch to Bank 1 where from there you set
the ports' state. Even though Microchip hates us for doing it, it's easier to
just use the TRIS instruction to set the pin states.
>
> Is the access method for output the same as for input? Help. Thanks much.
Yes
>
> Regards,
> Ricardo F. Chung
> Kingston, Jamaica
>
Hope this helps,
Tim Hamel
2000\01\10@014527
by
David Duffy
|
<x-flowed>Ricardo F. Chung wrote:
>Hello Everybody,
>
>Well, thanks to the RTF from Tim Hamel
>(http://pc-tek.hypermart.net/begin.rtf) I am well on my way with learning
>about PIC programming. I am having one hitch though.
>
>Could anyone say how the heck I access ports A and B? I am not entirely
>clear on how and when to use the STATUS register to enable port access.
>
>Is the access method for output the same as for input? Help. Thanks much.
The STATUS register is not required for port access.
Treat the port just like any other register - use MOVF & MOVWF for I/O.
You must however set the port up first by setting the respective TRIS
registers.
The Microchip data sheets & examples should give you the idea.
Regards...
___________________________________
David Duffy Audio Visual Devices
Ph: +61 7 38210362 Fax +61 7 38210281
.....AVDKILLspam
@spam@uq.net.au Unit 8, 9-11 Trade Street
Cleveland, Qld, 4163, Australia.
___________________________________
</x-flowed>
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- Today
- New search...