K
K
kykyryky2015-06-14 00:20:20
Programming
kykyryky, 2015-06-14 00:20:20

What is stored in the registers of the PIC18 controller?

PIC18F84A controller.
Initialization of the PORT and TRIS registers.

TRISA = %11111111 //все выводы порта А - входы
PORTA = %00000000 
TRISB = %00000000 //все выводы порта B - выходы
PORTB = %00000000

It is not clear about PORTA = %00000000 - on Habré I read that these are "all outputs of port A with a low level." What does it mean?
It is also not very clear what the parameters PORTA.0, PORTA.1, PORTA.2, etc. mean?
for example
if(PORTA.0 == 0)
{
...
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2015-06-14
@kykyryky

it is "all port A pins low". What does it mean?

This means that the pins associated with port A will go low. But only if the corresponding bit is configured as an output. A pin configured as an input is not affected by what is written to port A.
These are individual bits of Port A.

V
Vladimir pervokvaker, 2015-07-12
@Keroro

Some strange notation, usually the Microchip has binary numbers written as 0b00000000. And on PIC18 it's better to use LATA rather than PORTA to avoid "read-modify-write" problem (use PORT to read port status, and LAT to write logic level).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question