View previous topic :: View next topic |
Author |
Message |
attabros
Joined: 28 Jul 2008 Posts: 35
|
Binary Data in & out. |
Posted: Wed Jun 24, 2009 4:43 am |
|
|
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
|
|
Posted: Wed Jun 24, 2009 5:02 am |
|
|
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
|
|
Posted: Wed Jun 24, 2009 5:12 am |
|
|
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
|
|
Posted: Wed Jun 24, 2009 5:27 am |
|
|
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
|
|
Posted: Wed Jun 24, 2009 6:22 am |
|
|
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
|
|
Posted: Sun Jul 05, 2009 10:35 pm |
|
|
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. |
|
|
|