Discussion in "Project Help" started by    msideal    Oct 16, 2014.
Sat Oct 25 2014, 12:44 am
#11
Assembly Language Code:
.INCLUDE "M16DEF.INC"
LDI R20,HIGH (RAMEND)
OUT SPH,R20
LDI R20,LOW (RAMEND)
OUT SPL,R20;

LDI R16, 0XFF ;
OUT DDRC, R16 ; TO SET PROTC AS OUTPUT
CBI PORTC, 0 ; TO CLEAR STB PIN WHICH IS CONNECTED TO PROTC.0
LDI R17, 0x81 ; OUR DATA

CLC ; TO CLEAR CARRY REGISTER
LDI R18,8 ; WE HAVE TO RUN LOOP FOR 8 CYCLES THAT IS Y WE HAVE KEPT 8

AGAIN:
ROL R17 ; FOR ROTATING OUR DATA
BRCS ONE ; OF CARRY IS HIGH THEN GO TO ONE
CBI PINC,1 ; OF CARRY IS 0 THEN SET DATA PIN TO 0 MANUALLY
JMP NEXT ;

ONE:
SBI pinc,1 ;

NEXT:
SBI PINC,2 ;
CALL DELAY ;
CBI PINC,2 ;
CALL DELAY ;
DEC R18 ;
BRNE AGAIN ;
SBI PINC,0 ;IN THE END WE HAVE TO SET HIGH THE STROBE PIN

HERE:
JMP HERE ;

DELAY:
LDI R22, 29 ;
LOOP:
NOP ;
DEC R22 ;
BRNE LOOP ;
RET
Sat Oct 25 2014, 02:25 am
#12
Try holding STB high all the time.
You might as well attach your full Proteus project so we can test it.
 msideal like this.
Sun Oct 26 2014, 06:08 pm
#13
Hi Friends,
I made the strobe pin high before sending the data. After that the leds i want to open, they didn't hold. I am using Proteus to simulate it. As i start the simulation, the leds start on one by one, but that led which i want to hold it, that couldn't hold and it goes off....
Proteus diagram is attached....
Please help me out.
Thanks
Cheers...


[ Edited Sun Oct 26 2014, 06:11 pm ]
Sun Oct 26 2014, 06:08 pm
#14
Assembly Language code is here:::::.......... I made strobe high before sending the data
.INCLUDE "M16DEF.INC"
LDI R20,HIGH (RAMEND)
OUT SPH,R20
LDI R20,LOW (RAMEND)
OUT SPL,R20;

LDI R16, 0XFF ;
OUT DDRC, R16 ; TO SET PROTC AS OUTPUT
SBI PORTC, 0 ; TO CLEAR STB PIN WHICH IS CONNECTED TO PROTC.0
LDI R17, 0x81 ; OUR DATA
START:
CLC ; TO CLEAR CARRY REGISTER
LDI R18,8 ; WE HAVE TO RUN LOOP FOR 8 CYCLES THAT IS Y WE HAVE KEPT 8

AGAIN:
ROL R17 ; FOR ROTATING OUR DATA
BRCS ONE ; OF CARRY IS HIGH THEN GO TO ONE
CBI PINC,1 ; OF CARRY IS 0 THEN SET DATA PIN TO 0 MANUALLY
JMP NEXT ;

ONE:
SBI pinc,1 ;

NEXT:
SBI PINC,2 ;
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY ;
CBI PINC,2
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY ;
CALL DELAY ;
DEC R18 ;
BRNE AGAIN ;
CBI PINC,0 ;IN THE END WE HAVE TO SET HIGH THE STROBE PIN

JMP START ;

DELAY:
LDI R22, 29 ;
LOOP:
NOP ;
DEC R22 ;
BRNE LOOP ;
RET
Sun Oct 26 2014, 06:11 pm
#15
Proteus file is here
Mon Oct 27 2014, 12:15 am
#16


Proteus file is here

msideal


Convert your Proteus file(s) to a Zip file before attaching.
Include the .hex file as well, so we don't need to
assemble/compile your code.


[ Edited Mon Oct 27 2014, 12:19 am ]
Mon Oct 27 2014, 12:46 am
#17
sorry guys, i can't able to put the proteus file
The zip file is attached here
In this both circuit diagram and hex are attached
Mon Oct 27 2014, 03:54 am
#18


sorry guys, i can't able to put the proteus file

msideal



Only a certain file types can be attached.
"Allowed file types: | .zip | .gz | .jpg | .png | .gif | .rar | .pdf |"

The hex file you uploaded does not seem to be for the code in
your post 14.

For a test, what do you want to happen ?
Mon Oct 27 2014, 11:15 pm
#19
i want to extend my i/o's by writing this code. i have to attach five CD4094 to get 40 outputs. At the moment i'm using only one CD4094 to check how it works...... but problem is... the leds that i want to be open. They don't on and other leds on... what's the problem??? I also made the hardware and check on it as well. but problem remains same
Tue Oct 28 2014, 03:59 am
#20
Your error seems to be the use of PINC, which is for
reading input, not setting output.

This code should be a good starting point.
I posted the wrong one earlier.

It writes the data in variable "pattern" to the 8 LEDs, then stops.
Attachment


[ Edited Tue Oct 28 2014, 04:46 am ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am
utaletxcyw
Wed Apr 17 2024, 10:21 am
Anthonyvab
Wed Apr 17 2024, 08:48 am
RobertCix
Wed Apr 17 2024, 06:46 am