Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 05:14:43 17:14


Login with username, password and session length


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

Posts: 171

Thank You
-Given: 62
-Receive: 20



« on: January 13, 2008, 06:49:10 06: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
*****
Offline Offline

Posts: 556

Thank You
-Given: 156
-Receive: 354


« Reply #1 on: January 13, 2008, 11:19:32 11: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
V.I.P
Active Member
*****
Offline Offline

Posts: 147

Thank You
-Given: 355
-Receive: 49



« Reply #2 on: January 13, 2008, 06:30:28 18:30 »

Hi,

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

It is regarding using the 74HC165.

Cheers.
Logged
localcrack
Active Member
***
Offline Offline

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #3 on: January 15, 2008, 07:36:45 07: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

 Muted
Offline Offline

Posts: 4

Thank You
-Given: 1
-Receive: 0


« Reply #4 on: January 20, 2008, 02:27:44 14:27 »

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

Posts: 171

Thank You
-Given: 62
-Receive: 20



« Reply #5 on: January 21, 2008, 09:09:41 21: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