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.

CS5550 code problem in relation to displaying values on 7-segment

Status
Not open for further replies.

Kumar_373

Junior Member level 1
Joined
Nov 22, 2003
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
158
Can any one help me with following code it is displaying only zero in the 7 segment leg even if i increasing Vin
I have connected CS5550 SDI,SDO,SCK to 8051 port1

Thanks



AD_VALUE_00 EQU 30H ; R:30H
AD_VALUE_01 EQU 31H ; R:31H
AD_VALUE_02 EQU 32H ; R:32H


AD_DO BIT P1.0 ; CS5550UTPUT PORT
AD_SK BIT P1.1 ; CS5550 CLOCK PORT
AD_DI BIT P1.2 ; CS5550 INPUT PORT



org 8000h
ljmp main




main: mov sp,#0dfh
acall init_5550

adc_scan: acall ad_read
mov ad_value_02,a
mov 60h,a
lcall 019bh

acall ad_read
mov ad_value_01,a

mov 60h,a
lcall 019bh

acall ad_read
mov ad_value_00,a

mov 60h,a
lcall 019bh

ret

ad_read: mov b,#08
read_next_bit: clr ad_sk
nop
mov c,ad_do
rlc a
setb ad_sk
;nop
;nop
djnz b,read_next_bit
ret




init_5550: mov a,#04h ;write enable command
acall ad_write ;gain PGA
mov a,#00h
acall ad_write
mov a,#00h
acall ad_write
mov a,#00h
acall ad_write ;gain


mov a,#04h ;write enable command
acall ad_write ;filter
mov a,#00h
acall ad_write
mov a,#00h
acall ad_write
mov a,#20h ;High pass filter enable
acall ad_write ;

mov a,#74h ;write enable command
acall ad_write ;conversion
mov a,#80h
acall ad_write
mov a,#00h
acall ad_write
mov a,#00h
acall ad_write

mov a,#0e8h ;start conversion
acall ad_write
sjmp adc_scan

ad_write: mov b,#08
write_next_bit: clr ad_sk
rlc a
mov ad_di,c
setb ad_sk
nop
djnz b,write_next_bit
ret
end
 

Re: CS5550 code Problem

I have seen the same post at 8052.com forum where there are chances of spreading civil war if someone there come to know about you being a member of our forum also ;-) .

Use some easy compiler Bascom or C and then try it .I guess less people will have time to read all your ASM program . The zero you say could also result from error in the hardware or faulty chip carefully design the hardware and also try it with other chip if you already have it .
Ts
 

Re: CS5550 code Problem

hai,

this is hari, i have seen your code. i didn't find any serial port initialization section in your code. where do you have written it. i think you didn' t use reset pin. check it. read the data sheet of cs5550 once again and do it. use sync0 and 1 commands.

thanking you
hari krishna nori
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top