I would like to work with dsPIC30F2020 SMPS chip and I tried ADC modul.
Here is my samle code:
program smps
dim ff1, ff2, ff3 as real
txt as string[20]
dim i as byte
dim k as word
dim voltage, a, b, c as float
trisd = %11111110
TRISF = %10111111
TRISE = %11011111
delay_ms(1000)
Soft_Uart_Init(PORTD, 1, 0, 2400, 0)
delay_ms(10)
loop1:
k = Adc_Read(0)
voltage = 5/1024*k
Soft_Uart_Write(0x0C)
FloatToStr(voltage, txt)
for i=0 to 5
Soft_Uart_Write(txt)
delay_ms(10)
next i
PORTE.5 = 0
PORTF.6 = 1
delay_ms(500)
PORTE.5 = 1
PORTF.6 = 0
delay_ms(500)
goto loop1
end.
This program work with AN0 channel only. Have anybody idea about this problem? Why dont work when I change the channel number in expression?
SMPS chip ADC problem
Hi,
I have seen the problem you are talking about, and I have reported it to our developers. There might be a library issue with this particular chip, and we are going to investigate it and give you a feedback on the result.
Thank you for reporting this and sorry for the inconvenience.
Best regards,
Aleksandar
I have seen the problem you are talking about, and I have reported it to our developers. There might be a library issue with this particular chip, and we are going to investigate it and give you a feedback on the result.
Thank you for reporting this and sorry for the inconvenience.
Best regards,
Aleksandar
Web Department Manager
Hi,
You might expect mikroC PRO beta and mikroPascal PRO beta as far as today late in the afternoon, and mikroBasic PRO beta next week, most probably Monday.
"I2C issue" is actually not considered an issue. It's just the way we decided to implement the library. But, since we have lots of our customers who would like this to be handled in some way, we will consider implementing some kind of timeout for this function, so the program can continue even with no slave present. But this, if accepted, will be implemented in the official release, expected to be launched by end of December.
Best regards,
Aleksandar
You might expect mikroC PRO beta and mikroPascal PRO beta as far as today late in the afternoon, and mikroBasic PRO beta next week, most probably Monday.
"I2C issue" is actually not considered an issue. It's just the way we decided to implement the library. But, since we have lots of our customers who would like this to be handled in some way, we will consider implementing some kind of timeout for this function, so the program can continue even with no slave present. But this, if accepted, will be implemented in the official release, expected to be launched by end of December.
Best regards,
Aleksandar
Web Department Manager