CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I2C issues... can't get an ACK. Big demo tommorow :(

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
blak3r



Joined: 11 Jan 2004
Posts: 45

View user's profile Send private message Visit poster's website

I2C issues... can't get an ACK. Big demo tommorow :(
PostPosted: Thu Jul 22, 2004 11:10 am     Reply with quote

davidpk



Joined: 29 Apr 2004
Posts: 13
Location: Opelika, AL

View user's profile Send private message Yahoo Messenger

PostPosted: Thu Jul 22, 2004 12:05 pm     Reply with quote

Are you sure you didn't accidentally change the device address with your drivers? Can you look at the signals on an O'Scope?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 22, 2004 12:12 pm     Reply with quote

1. You should post a complete demo program. It doesn't have to
be much longer than what you posted, but you should show main(),
and all pre-processor statements and compiler directives.
The lines of code that you think are not important and therefore
should not be posted, could very well be the cause of your problems.

2. This chip is in a QFN package. Did you solder it to the board
yourself ? Do you know for certain that it's soldered in correctly ?
Do you know for sure that the orientation of the chip is correct ?

3. I notice you have LVP in your #fuses statement. That means
you want to use Low Voltage Programming mode. Are you really
doing that ? What programmer are you using ? How do you
keep that Pin B4 in a safe state when the programmer is not
connected ? Do you have a pull-down resistor on the pin ?
Also, according to the data sheet, LVP mode only works at 5v.
(Section 14.3) But you said your Vdd is +3.3v. Are you
removing the chip from the circuit to program it ?
blak3r



Joined: 11 Jan 2004
Posts: 45

View user's profile Send private message Visit poster's website

PostPosted: Thu Jul 22, 2004 12:27 pm     Reply with quote

1) I understand. The computer i was developping couldn't connect to the net so i retyped the code. Other then what i posted i set the comparators to NC_NC_NC_NC and disabled the timers.

2) I had professional solder it that's been doing rework for 30 years.

3) I had a problem with my board that it would not operate at 3.3V but would operate at voltages above 4.2V. I changed the fuses from BROWNOUT -> NOBROWNOUT and NOLVP -> LVP and that fixed the problem. I do not gurantee that B4 is held low. I'm going over to a lab now. I will change the fuse setting to NOLVP. Could this really cause an issue with my code?


Another note: using a multimeter when my i2c code is executing the multimeter reads 1.3V.
_________________
"Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein

http://www.blakerobertson.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 22, 2004 12:53 pm     Reply with quote

Quote:
1) I understand. The computer i was developping couldn't connect
to the net so i retyped the code. Other then what i posted i set the
comparators to NC_NC_NC_NC and disabled the timers.

What about the #use delay() statement ? A recent poster left off
one of the 0's in his clock speed declaration. That's why I always
want to see everything.

Quote:
2) I had professional solder it that's been doing rework for 30 years.

Have you personally checked the orientation ? Does pin 1 on the chip
go to pin 1 on the pad pattern on the board ? Are the power and ground
pins really connected to +3.3v and GND ? Verify this.

Quote:
I will change the fuse setting to NOLVP. Could this really cause an issue with my code?

So are you actually using High Voltage programming ? What is
your programmer ?
Yes the LVP fuse can cause the entire PIC to lock up. If the fuse is set,
whenever the PGM pin goes high, then the PIC goes into programming
mode. If the pin is left floating, it can go high at apparently random
times, and your PIC will act erratically. If you're not using LVP mode,
then definitely change the fuse to NOLVP.
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Jul 22, 2004 12:54 pm     Reply with quote

First, if you connect a meter up to a toggling signal you will see about the middle of whatever it is toggling at ie. 0v - 3.3v is about 1.3v, 1v - 5v is about 2.5v.

Second, I would remove your output_float() statements. I'm not sure if this puts the I/O into Input mode or not but they DO need to be set to be Inputs.

Third, you really need a scope to watch the signals. I use one that will capture the signal and I can then scroll to see exactly what's happening with them.

Fourth, maybe try about a 4K resistor. Who knows, maybe they need a little more 'umph' to be pulled high.

Just make sure that your compass is set at the correct address.

Ronald
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Jul 22, 2004 1:19 pm     Reply with quote

Besides the #use delay also provide us with the #use RS232 declaration!

Are you sure the SDA and SCL pins are connected to the correct pins on the HMC6532 and not twisted?

Are you using the hardware UART for the RS-232 transmission? If yes, than this might be your problem as the PIC16F628 has the hardware Rx on RB1, the same pin you are using for SCL...... Twisted Evil
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group