I am using an EPM900 to emulate the P89LPC933 from philips. I do not manage to configure the A/D converter available in the micro and get it to work. Need to perform a single conversion on the AD10 pin (P0.1). Do you have any sample code in assembler
Do you have any sample code in assembler Why not show your code? Erik
Here goes this part of the code MOV P0M1,#10001110B MOV P0M2,#01110000B MOV PT0AD,#00000010B MOV ADMODB,#000H ; This dam thing does not leave MOV ADINS,#0x010 ; me alone MOV ADMODA,#0x010 MOV ADCON1,#0x05 ; Go to work
This dam thing does not leave A language problem, I'm sure, please explain. Are you saying that the uC stop on that instruction? Erik
When i execute the above lines the SFR's do not assume the new value.
show it all. some LPC pins can not be modified if bthey are assigned as certain things (e.g. enable IIC and the pins can only be set OC) also, before selecting analog pins on P1 you should configure P1M1 and P1M2 Erik
I am using port o, as you can see on the code. I use P0.1 as input pin for the A/D to perform a single conversion. I am using the pin to read the battery voltage of the equipment. Why don't the control registers assume the configuration values?
Why don't the control registers assume the configuration values? as stated before, the SFRsa will only accept "legal" values. Have a look at what you set and what you get and check that in the user guide. If that does not clear it up in half an hour, post what you set and what you get. Erik
The values remain at 0
The values WHAT values? Erik
The SFR values. When i perform the mov instruction, the rigister does not assume the new configuration value.
well one step at the time mov a,#47 if the emulator show acc to be 47, so far, so good MOV P0M1,#10001110B mov a,P0M1 what does a show what does p0m1 show
When i perform the following instructions the ADINS does not assume the new value MOV A,#0x010 MOV ADINS,A
I am trying to help you, DO WHAT I ASKED, not something else Erik
Thanks. That works fine.
What next
Earlier: Q:the SFRs .....Have a look at what you set and what you get A:The values remain at 0 Now: Q:.... MOV P0M1,#10001110B ....what does p0m1 show A:That works fine. One is bullshit, which one
I think i mentioned that the problem is configuring the A/D registers not the Port 0. The registers i do not manage to configure are ADMODB ADINS ADMODA ADCON1 Therefore the A/D does not work.
Ok, I give up
"Ok, I give up" He has told you that the registers beginning with 'P' change their values in accordance with what is written to them, however the registers beginning with 'A' do not.
then taking what I suggested and do it with a P register should not be rocket science. Spoon feeding is over. Erik
I have tried what you have suggested with all the registers and still does not work. The instructions wark fine are the port configuration registers, the A/D do not accept the required configuration values. Is this a bug on the EPM900?
I have tried what you have suggested with all the registers and still does not work. I never asked "does it work" I asked "what is the result !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" This is why I posted "I give up" I ask "are the apples ripe" you answer "the dandelions are yellow" Erik
Here goes your straight answers: A first shows 2F then 8E P0M1 shows 8E What is your next suggestion?
It was stated above that the 'P' registers work but the 'A' register do not. So, WHY do you give me an answer about a 'P' register? This is NOT! trying to "make it work" this is "find out what does not work" Erik
Call it whatever you want. The fact is that i can not get it to work because i do not know where the problem resides, LPC933 or EPM900 and how to overcome it. That is the reason why i am asking for technical support. Can you help?
I think Erik has been patiently trying to help you but you are not giving him the information is is asking for. With this information he may be able to determine where the problem is. You may be able to learn from his approach if you cooperate.
The A registers maintain the values inaltered, at 0
I state: This is NOT! trying to "make it work" this is "find out what does not work" You reply: "The fact is that i can not get it to work because i do not know where the problem resides," Once more I ask you to do something in order to narrow down what the problem is and you reply "i do not know where the problem resides". NEITHER DO I (and based on the lack of other responses neither does anyone else) So I am suggesting a debugging technique for you to work by - I know, I should build a copy of your board, buy the same emulator you use and find out here the exact cause of the problem you have and then come back with an answer that makes it easy for you. That is not going to happen unless you pay me a hefty consultant fee, however much you wish. My Keil/Ceibo combo does not have the problem. If you want ANY more support from me for free, go through the steps I suggested above for a "failing SFR" and post the answer to the questions by copying the question and adding the answer. I am trying to help you so, if you are not willing to work with me, why should I continue. Erik I was stupid enough to come back after saying "I give up". An absolute statement If you respond in ANY way other than replying to my questions and NOTHING else, this is my last post in this thread.
View all questions in Keil forum