473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

MSP 430 Probs

Hello =) I have a problem with a Microcontrolle and its programming in C.
I trie to write some Registers on the command line, but I get the warning: "makes pointer from integer without a cast". Here the border facts:


//This ist the parse method I have to use:

UINT16 String_parseInt(const UINT8* c, UINT8** ptr) {
UINT16 i = 0;
while((*c >= 0x30) && (*c <= 0x39)) {
i = i * 10;
i = i + (*c - 0x30);
c++;
}
if(ptr!=NULL) *(ptr) = (UINT8*) c;
return i;
}


//This is my method where I get the error:
MEM0 = String_parseInt(ADC12MEM0, NULL);

//ADC12MEM0 is a Register on the microprocessor and is NOT a pointer. I am not familiar with C so I don´t know what I make wrong =(

Thanks 4 your Help, Coka
Jul 9 '07 #1
1 1608
weaknessforcats
9,208 Expert Mod 8TB
You cannot read from or write to specific registers in C.

You will need to declare a volatile variable:

Expand|Select|Wrap|Line Numbers
  1. volatile const UINT8* data;
  2.  
and then you will need to insert some assembly code after this declaration to unload the ADC12MEM0 register to the location of the variable.

If you are using Visual Studio.NET, you can drop into assembly by invoking the inline assembler in your C code:
[code=c]
volatile const UINT8* data;
_asm
{
//put your assembly code here.
}

If you are not using Visual Studio.NET, then consults your docset.
Jul 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Psykotik | last post by:
Hello, I've two problems with php. My spec : Windows XP SP1, KFWS 2.2.0, IE 6 SP1, PHP 4.3.3. Web server is "KF web server", a server very very user friendly (HTML interface), and which...
6
by: LRW | last post by:
Because I've had recipients of our newsletter tell us they can't (or won't) receive HTML e-mail, I found out how to make an e-mail that sends both HTML and a plaintext version in a multipart...
2
by: Dynamo | last post by:
Hi all Further to my earlier posting and the advice recieved I have now modified my code but it still doesn't work. I am trying to upload a file from my local PC to my remote server by using a...
145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
2
by: Tony of Judicious | last post by:
Not sure if this is right ng but i'm trying to install Rekall on Suse 9 prof During ./configure i get the msg: checking for X... configure: error: Can't find X includes. Please check your...
1
by: Arijit Chatterjee | last post by:
Hi Everybody, I am facing another probs. I have created a trigger for table Tab1 for perticular column col1 for checking value ranges.But at time for using insert statement it is working fine but...
2
by: andrewcw | last post by:
Seems it should be simple. I had problems with a larger class and the newsgroup suggested something I also tried. So I pruned my class to see if I could find out what could be wrong, Still dont...
7
by: polecat | last post by:
Im new to .NET and I am having probs with this Every time I reload the form the same data is repeated again.... Done reading on msdn and another forum cant figure out why the...
0
by: bkpatel | last post by:
get Join the PHP community and share ur probs - soln <table border=0 style="background-color: #fff; padding: 5px;" cellspacing=0> <tr><td> <img...
2
by: brettokumar | last post by:
hai im storing value in cookies. if my 2nd value or 3rd value is stored means my previous cookies are expired my current cookies only stored others cookies values will be null how to i solve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.