CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Binary Data in & out.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
attabros



Joined: 28 Jul 2008
Posts: 35

View user's profile Send private message

Binary Data in & out.
PostPosted: Wed Jun 24, 2009 4:43 am     Reply with quote

Hi Everyone,

I have designed a control circuit for an inverter using Parallel EEPROM
At28C64B it has address bits from A0-A12, now form A0 to A7 is selected by binary counter which is Y decoder, the rest bits A8-A12 connected with
5 way dip switch which is X decoder the circuit works fine.

Now i want to use a PIC microcontroller 16F877A & want to connect a dip switch with PIC as an input that binary data on port B , & the output the same binary data on the port D(the data then send parallel to EEPROM A8-A12 for X decoder selection)

The reason for using the PIC instead of simple dip, after this task i have to take some analog inputs from field for automatic selection.

Kindly help me out,

thanks,
Asim Rauf
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Wed Jun 24, 2009 5:02 am     Reply with quote

Post some picture of what you want to be done. From your writing I don't quite get the picture.
attabros



Joined: 28 Jul 2008
Posts: 35

View user's profile Send private message

PostPosted: Wed Jun 24, 2009 5:12 am     Reply with quote

the binary data will be in following format


A12-A8
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111
Ttelmah
Guest







PostPosted: Wed Jun 24, 2009 5:27 am     Reply with quote

The bit that is 'missing' from the description, is how you want to output the 'binary' data. Basically, there are two ways, synchronously (a clock sent along with it), or asynchronously (no clock line, but instead 'timed'). Both are 'standard' things to do, look at 'SPI', and 'RS232' (more correctly async inverted TTL serial). I'd imagine from your description, you actually need synchronous comms,with a bit of data output on a pin, then a 'clock' signal on another pin, connected to your lshift register. You PIC, has SPI hardware, or the CCS libraries, support software SPI, or there are a large number of examples in the CCS example files, for doing exactly this.

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jun 24, 2009 6:22 am     Reply with quote

This code is exactly representing your above description.
Code:
void main(void)
{
while (1) output_d(input_b());
}
attabros



Joined: 28 Jul 2008
Posts: 35

View user's profile Send private message

PostPosted: Sun Jul 05, 2009 10:35 pm     Reply with quote

Now I want to output the binary data (00000 to 11111) which I have mentioned before, on Port D one by one automatically with some delay, so that I can observe the output on oscilloscope.

How it could be possible ?

Thanks.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group