Sonsivri

Electronics => Pic C Languages => Topic started by: kanishka13 on January 29, 2010, 08:05:45 08:05



Title: How do I best use the PORTE of 40-pin PIC uC ??
Post by: kanishka13 on January 29, 2010, 08:05:45 08:05
Hey folks,

Any suggestions on what kind of applications does a 4-bit PORT provide?.

The datasheet of PIC18f4520 says "For 40/44-pin devices, PORTE is a 4-bit wide port.Three pins (RE0/RD/AN5, RE1/WR/AN6 and RE2/CS/AN7) are individually configurable as inputs or outputs.These pins have Schmitt Trigger input buffers".

I understand what I can do with the analog input channels.... but was interested to know about the 4-bit port operation.. are their any LCD or memory ICs that I can interface to the 4bit port? ???

Shukriya


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: oldvan on January 29, 2010, 09:36:52 09:36
Pushbutton switches, LEDs, input form a rotary encoder, select pin for an EEPROM, I/O for a DS18B20 temperature sensor....


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: kayvee on January 29, 2010, 11:15:12 11:15
I think it's just the terminology they use.

Port E is only a 4 bit port whereas, for example, Port A is an 8 bit port. i.e. only has 4 pins assigned to Port E.  You can use the pins as any of the named functions for that pin (RE0 input /output, or /RD, or AN5) or together as a 4 bit wide port, depending on how you drive/configure them, much the same as any other 8 bit port on the part, or make them as wide as you want.  Nothing else implied, really.


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: hate on January 30, 2010, 06:24:12 06:24
I used to use the 3-bit versions on pic16 chips for LCD command pins and data pins on some other port to not to lose an i/o pin when they are used on the same port.

Regards...


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: frasenci on January 30, 2010, 12:09:58 12:09
I think it's just the terminology they use.

Agree with that.
In my experience I have always used every pin on a PIC as per its particular functionality described in the corresponding Datasheet.
In adressing each particular pin and depending on Programming langauage/compiler you end up using syntax as portaA.1, portE.2 etc but it is only a convention.

Perhaps the only advantage on using the "port" concept is when you simultaneously toggle pin states on a particular port using syntax as portE = %0100 ( again depending on programming platform used ) , acomplishing the modification of the state of 4 pins ( in this example ) in only 1 line of code.

The only "port" concept on a PIC coming from hardware design side I have encountered, is the SPP ( Streaming paralell port ) you find in for example 18F45550 ( uses the 8 bits of "portD" ) but then again , settings depend on those of other "pins" of other " ports"...

I would say you stay with the "unitary" approach and treat every pin as a its own, Datasheet on the other hand (always)  provided.

Greetings
FAA
 


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: metal on January 30, 2010, 09:02:28 21:02
Best way is goverened by your PCB layout and peripherals on that PORT!

When it is easier to use PORTX.[0..7] for the sake of making the layout looks neat, single sided, less vias if double sided, then why do you really care unless you can not control it with your software? So for example when you use a readily available LCD library that restricts you to use a single port, or use either the 4 lower or upper pins, then you are restricted, otherwise look at the datasheet, the missing bits from that 4 bit port are indicated to be read/written as in the datasheet.


Title: Re: How do I best use the PORTE of 40-pin PIC uC ??
Post by: mrpicing on February 01, 2010, 03:25:34 03:25
I agree with "frasenci". he best explained the port. besides this these low count pin are very usefull to interface with RTCC or any other spi/serial/i2c devices.
I ever use rtc or leds on my board with PORTE.