Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

sample program to read serial inputs from 74Hc165 to pic18f4620 in pic programming

Status
Not open for further replies.

viv1988

Newbie level 6
Joined
Dec 30, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mysore
Activity points
1,365
I am doing a project where i have to connect 2 74HC165 to the pic18f4620.I am not getting how to read the serial output from 74HC165 to the PIC Microcontroller.PLs
PLS someone suggest me how to do it in PIC programmin wih a sample program so that i can understand.
Thank you.
:(

---------- Post added at 11:54 ---------- Previous post was at 11:53 ----------

pls do reply me asap
 

sir i am not able to post a schematic as it is in pdf format.
 

press print screen and post the bitmap or attach the pdf.
 

sir this is my schematic jus have a look on it and do the needful.... viv.JPG
 

the schematic does not have good analysis..
Please send better image. So i see the connection of 74HC165.

are you writing in assembly or C?
 

i am writing code in c language.And one more thing sir i can write a program to shift data from 74HC165 to pic18f4620 but how to write that 74HC165 o/ps into the data registers of PIC18f4620A.Am attaching the better pic jus check connections and tell pls.....**broken link removed**
 

embedded.JPG.....i am writing code in c language.And one more thing sir i can write a program to shift data from 74HC165 to pic18f4620 but how to write that 74HC165 o/ps into the data registers of PIC18f4620A.Am attaching the better pic jus check connections and tell pls.....
 

is der anyone who can help me.......i jus want to know how we can reads the input from 74hc165 and write those inputs on to the pic18f4620.......am doin coding in c.......
pls share some of ur knowledge with me.......
 

Interface to 74HC165 shift register

#define loadPin PORTE.F0 // 74HC165 PIN #1
#define clockPin PORTE.F1 // 74HC165 PIN #2
#define dataPin PORTE.F2 // 74HC165 PIN #10
#define clkENPin PORTE.F3 // 74HC165 PIN #15

// Gen working vars
unsigned char i = 0;
unsigned char j = 0;

// Specific vars
unsigned char bitValues[8] = {1,2,4,8,16,32,64,128};
unsigned char bcdDataReadIn = 0;
unsigned char readRegister = 0;

unsigned char shiftIndataFromRegister()
{
// Null
bcdDataReadIn = 0;

// Enable the register!
clkENPin = 0;

// Tell register to look at the state of its D0 - D7 pins
loadPin = 1;
asm nop;
loadPin = 0;

// Read the bits on the register and store in var bcdDataReadIn
for (i = 0; i < 7; i++)
{
// Clock the register
clockPin = 1;
asm nop;
clockPin = 0;

// Compare: bit set?
if (dataPin == 1)
{
// Add to BCD value
bcdDataReadIn += bitValues
}
}

return bcdDataReadIn;
}

void main()
{
while(1)
{
// Boolean flag set to perform this function?
if (readRegister == 1)
{
// Fetch it! range is in 0-255 stored in return var
shiftIndataFromRegister(bcdDataReadIn);
}
}
}
 
Sir the code u have given is it for storing and reading on to the memory of the PIC18F4620?
I want to store the data that is coming from 74HC165 into the memory location of the data registers of PIC.
Enlighten me on that.
thank you so much



Regards
viv1988
 

pls someone help me in this project ...... will be very thankful to u
 

Garg sir i got to know how to read data from 74HC165......but i want to know how i can read those bits on pic18f4620.......after readin those bits i have to store them on memory locations one by one on pic18......from der i have to send them to output pins of pic.......
 

Still am facin the same problem...... am not gettin how to store 8 bits in consecutive memory addresses in eeprom of pic 18......after storin dem i have to read the status of stored bits........ then send them to pic output.....pls can anyone help me with this.....i am stuck.

Thanks in advance

Regards
viv1988

---------- Post added at 10:57 ---------- Previous post was at 10:56 ----------

Still am facin the same problem...... am not gettin how to store 8 bits in consecutive memory addresses in eeprom of pic 18......after storin dem i have to read the status of stored bits........ then send them to pic output.....pls can anyone help me with this.....i am stuck.....i am writin code using c.

Thanks in advance

Regards
viv1988
 

if someone wants to see how to expand input lines using 74hc165
then see below link
**broken link removed**
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top