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.

Problem with reading from a sensor in a code to work with AVR and HMC5843

Status
Not open for further replies.

khatarat

Member level 1
Joined
Mar 2, 2009
Messages
41
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,545
hi
i want to write a program in codevision to work avr with hmc5843 but i cant read from sensor

after send SLA +R the value of TWSR become 0x40 that means byte has sent and ack reseved but nothing placed in TWDR what is the problem?

TWDR=0x3D; // slave address for read
TWCR=0x84; // Enable TWI and Clear TWINT
while(!(TWCR&0x80));
//// TWSR is now 0x40
putchar(TWDR);//this print 0x3D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top