juani_c 66 Posted October 4, 2010 Share Posted October 4, 2010 Well, i am trying to make a library for the tmp175 temp sensor, (by the way i don`t have much idea about what i Quote Link to post Share on other sites
bluehash 1,581 Posted October 4, 2010 Share Posted October 4, 2010 Could you zip your project up and upload it here. Quote Link to post Share on other sites
gatesphere 45 Posted October 4, 2010 Share Posted October 4, 2010 Have you specified all your variable types? Like, if you're using an integer, did you define it like int variable_name; ? That's the only thing I can think of without seeing the code. Oh, and glad I could help Quote Link to post Share on other sites
juani_c 66 Posted October 4, 2010 Author Share Posted October 4, 2010 i am using IAR an the code is from parts of other codes. It has a lot of comments to make it easier to understand. the problem came up when i put this line; void tmp175_Config(Address, Config_Register, 0xE1); I know that i migth be making some silly mistake with the definitions, the variables types or something like that, but well i can not see it... :oops: by the way, this "library" is faaaaaaarrrrr from finished, and i dont TMP175.rar Quote Link to post Share on other sites
gatesphere 45 Posted October 4, 2010 Share Posted October 4, 2010 I can't see anything wrong with your code, aside from a non-traditional use of the USIIFG flag to force an interrupt. I'unno. Just one of those weird things, I guess. If you could post the code you were trying to use when the error is thrown, I might be able to help a bit more, but as of now, I'm stumped. Quote Link to post Share on other sites
juani_c 66 Posted October 4, 2010 Author Share Posted October 4, 2010 thanks for the reply!!! i'm not sure if i understand you rigth but the file that throws me un error when i try to compile it is the main.c Quote Link to post Share on other sites
gatesphere 45 Posted October 4, 2010 Share Posted October 4, 2010 Yeah, and from looking at the code you provided, I can't see any reason why it would do that. However, if you were calling your own function in an incorrect way (strange, but it happens), that might cause it. Any way you could post your main.c? Or PM it to me if you don't want to share it? Quote Link to post Share on other sites
gatesphere 45 Posted October 4, 2010 Share Posted October 4, 2010 Oh, wait! In the file launchpad.c that you attached, the following code snippet is wrong. void main{ void tmp175_Init(); } You missed the parentheses after main. They are required, even if there is no parameter to be passed in. Quote Link to post Share on other sites
juani_c 66 Posted October 4, 2010 Author Share Posted October 4, 2010 :oops: i uploaded a different file, thats why i wasn tmp175.rar Quote Link to post Share on other sites
bluehash 1,581 Posted October 4, 2010 Share Posted October 4, 2010 void tmp175_Config(Address, Config_Register, 0xE1); You have not defined "Config_Register". Also you do not need to put in void before the function when you call it. Quote Link to post Share on other sites
juani_c 66 Posted October 4, 2010 Author Share Posted October 4, 2010 well, i said that it would be some stupid mistake, thats what i get for copy and paste, thanks bluehash!! now i'm getting another error, but i think this one will be on my own... Quote Link to post Share on other sites
bluehash 1,581 Posted October 4, 2010 Share Posted October 4, 2010 You could ask it here, if you wish. We can walk you through it, if your code needs another pair of eyes. Quote Link to post Share on other sites
gatesphere 45 Posted October 4, 2010 Share Posted October 4, 2010 You could ask it here, if you wish. We can walk you through it, if your code needs another pair of eyes. What he said And wow, how did I miss that? I must be tired Quote Link to post Share on other sites
juani_c 66 Posted October 4, 2010 Author Share Posted October 4, 2010 I fix it!!! one of the functions works (at list the simulation), for the other one i will have to change the state machine, I took that part of the code from other file and instead of making me the things easier it turn the code a mess. I'll give it a shot in a couple of days ( I've had enough for today), the thing is that if i try to implement other functions it will be getting worst and worst... So my choices are: to use the same structure with the state machine, starting from scratch with my own code(the hard way, it will take a while) or use the TI I2C library(the easy way) thank you all for the help Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.