Missing insput param on Twi_Read?

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
vladaepro
Posts: 7
Joined: 29 May 2008 21:19

Missing insput param on Twi_Read?

#1 Post by vladaepro » 30 May 2008 11:01

Hi

I need to use Twi_Read function with acknowledge (for sequential read from eeprom 24cxxx), but compiler doesn't accept any params in that function. In help files, there are one input params - acknowledge on/off (tmp := Twi_Read(0);).

Is it a bug?

Thanx

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#2 Post by milan » 02 Jun 2008 14:46

Hi,

this is the help error, we apologize.

Twi_Read prototype is:

Code: Select all

function Twi_Read: byte;

vladaepro
Posts: 7
Joined: 29 May 2008 21:19

#3 Post by vladaepro » 04 Jun 2008 19:11

Thanx for reply

I understood it's a help error, but it's very logical to have param for ack in that function. As i said, you can't read sequential from TWI devices if don't send ACK on TWI_Read.

Ok, i fixed it with directly set/reset twea bit:
TWCR.TWEA := 1;
while TWCR and (1 shl TWINT) = 0 do nop;
data := TWDR;

Hope it will be implemented in next build of library...

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#4 Post by milan » 05 Jun 2008 07:30

Hi,
vladaepro wrote: Hope it will be implemented in next build of library...
It is added on todo list, thank you for your report/solution.

Post Reply

Return to “mikroPascal for AVR General”