Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 05:09:44 05:09


Login with username, password and session length


Pages: [1]
Print
Author Topic: CCS With 74HC165 Problem  (Read 4656 times)
0 Members and 1 Guest are viewing this topic.
localcrack
Active Member
***
 Muted
Offline Offline

Posts: 173

Thank You
-Given: 64
-Receive: 21



« on: January 13, 2008, 05:49:10 05:49 »

I am doing a project using PIC18F452, 20x2 LCD, DIP Switch & 74HC165. My project is just for reading a parallel input data serially, so I am connected all the inputs of 74HC165 to dip switch and developes c code for reading a DIP switch and display it on to the lcd. I am using CCS version 4.057. Now my problem is threre when I read the input data serially the collected data is not in order or some garbage values I cant find the problem. please help me where I am wrong or compiler is wrong. I also includes Proteus file for simulation.

http://rapidshare.com/files/83133472/Problem.rar.html

Posted on: January 12, 2008, 06:22:38 06:22 - Automerged

Anybody help me please...
Logged
hate
Hero Member
*****
 Warned
Offline Offline

Posts: 555

Thank You
-Given: 156
-Receive: 355


« Reply #1 on: January 13, 2008, 10:19:32 10:19 »

Did you check for hardware errors like mulfuntioning of 74hc165? I cannot see your schematic right now so I cannot check for errors but be sure you have the correct pins for clock and data. Also check for the inputs of 74hc165 as they may be floating!

Regards...
Logged

Regards...
jzaghal
Active Member
***
Offline Offline

Posts: 166

Thank You
-Given: 493
-Receive: 55



« Reply #2 on: January 13, 2008, 05:30:28 17:30 »

Hi,

Did you check "EX_EXPIO.C"  in the CCS examples folder.

It is regarding using the 74HC165.

Cheers.
Logged
localcrack
Active Member
***
 Muted
Offline Offline

Posts: 173

Thank You
-Given: 64
-Receive: 21



« Reply #3 on: January 15, 2008, 06:36:45 06:36 »

I also checks hardware errors and my schematic is true. CCS Examples also explains how connect 74HC165 to microcontroller and

I also connect in the same way.

actually the problem is there I am defining a structure and shift input data through 74HC165 to this structure and after I

access the value such as

j= Sensor.BOX[0]; etc

but the data is out of order

struct box_data
{
   boolean BOX[20];
   boolean PRX[10];
   boolean HOME;   
   boolean START;
   boolean END;
   boolean TUPL;
   boolean TLOL;
   boolean X_1;
   boolean X_2;
   boolean X_3;
   boolean X_4;
   boolean X_5;
}Sensor;

but when I define above structure as below then the input data is in order
as I access the data in following way.

j= Sensor.BOX[0]; etc.

struct box_data
{
   boolean BOX[40];
}Sensor;

so please find out the problem for me why the data of both structure is different and out of order.
Logged
engvidal
Inactive

Offline Offline

Posts: 4

Thank You
-Given: 1
-Receive: 0


« Reply #4 on: January 20, 2008, 01:27:44 13:27 »

why dont you do a software function ?
Logged
localcrack
Active Member
***
 Muted
Offline Offline

Posts: 173

Thank You
-Given: 64
-Receive: 21



« Reply #5 on: January 21, 2008, 08:09:41 20:09 »

Dear engvidal please explain me what you want to say about software function
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC