I have two inputs I need to send to PORTC. 1st input needs to go on 1st 4 bits and 2nd input needs to go next 4bits. How can I do that. Should I use output_portc(value) and send it twice or there is other way of doing this.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12421
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Re: Two inputs to Portc
Posted: Thu Mar 06, 2003 12:06 pm
Here is one such example:
data1 = 0x03;
data2 = 0x02;
temp = (data2<<4)&(data1&0x0f);
PORTC = temp;
:= I have two inputs I need to send to PORTC. 1st input needs to go on 1st 4 bits and 2nd input needs to go next 4bits. How can I do that. Should I use output_portc(value) and send it twice or there is other way of doing this.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12433
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Re: Two inputs to Portc
Posted: Thu Mar 06, 2003 1:29 pm
:= I have two inputs I need to send to PORTC. 1st input needs to go on 1st 4 bits and 2nd input needs to go next 4bits. How can I do that. Should I use output_portc(value) and send it twice or there is other way of doing this.
-----------------------------------------------------------
It seems like you're describing an LCD interface.
See the CCS example file, LCD.C, which shows how
to define several bits as a element of a structure.
Then you can write to those 4 bits with one line of code.
The LCD.C file is in this folder:
c:\Program Files\Picc\Drivers
___________________________
This message was ported from CCS's old forum
Original Post ID: 12439
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum