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
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