SMPS chip ADC problem

General discussion on mikroBasic for dsPIC30/33 and PIC24.
Post Reply
Author
Message
giants.comp
Posts: 5
Joined: 22 Sep 2009 09:04

SMPS chip ADC problem

#1 Post by giants.comp » 22 Sep 2009 09:17

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?

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#2 Post by anikolic » 02 Oct 2009 07:59

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
Web Department Manager

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#3 Post by anikolic » 07 Dec 2009 12:57

Issue solved! Changes will be active from the PRO release of compiler.

Best regards,
Aleksandar
Web Department Manager

nikhil
Posts: 35
Joined: 12 Jul 2009 06:24

#4 Post by nikhil » 08 Dec 2009 04:53

Hi Alex..by when we can expect the PRO Release..just wanted to confirm also if the I2C Hang issue is resolved in it. i.e. if slave not present ..the MCU doesnt stop there..

Will appreciate an update.

Many thanks..

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#5 Post by anikolic » 09 Dec 2009 10:35

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
Web Department Manager

nikhil
Posts: 35
Joined: 12 Jul 2009 06:24

#6 Post by nikhil » 09 Dec 2009 10:41

Thanks for the update. Could a bug fix list and new additions / improvements be also made available.

Post Reply

Return to “mikroBasic for dsPIC30/33 and PIC24 General”