Wow, thank you all who looked into this. I'm sorry not having noticed this. 
What a big difference two switched letters can make. Writing and reading now 
works.

Thanks!
-Timo


-----Original Message-----
From: Philipp Klaus Krause [mailto:p...@spth.de] 
Sent: Donnerstag, 12. Oktober 2017 15:49
To: sdcc-user@lists.sourceforge.net
Subject: Re: [Sdcc-user] STM8L152C6 can not write to ADC registers

I found the problem:

The clock to the ADC was off. It needs to be switched on using the correct 
PCKEN bit.
In the source posted, it looks as if the ADC clock got confused with the DAC 
clock: The comment indicates that the ADC clock is switched on where the DAC 
clock, but not the ADC clock is switched on.

Philipp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! http://sdm.link/slashdot 
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to