CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

SOLVED? i2c_isr_state() and transfers larger than 127 bytes
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19221

View user's profile Send private message

PostPosted: Fri Apr 28, 2023 12:51 am     Reply with quote

Your chips aren't ones where this applies. There are a couple of PIC's
(I think possibly only PIC16's), that have a 'smart' i2C peripheral. This
doesn't support direct operation at all, just support a block transfer.
The internal counter for this is 7bit in the hardware. These were the
chips for which I2C_transfer was first added about four years ago.
On your original post you referred to I2C transfer and i thought you
might be using one of the chips with this hardware.
The limit on I2C_ISR_state was just that for 99% of devices transfers
are normally only a few bytes, and the code is smaller to only use an
8bit variable. This is presumably the same reasoning that Microchip
limited the hardware transfers on these chips to this size as well.

allenhuffman wrote:
Ttelmah wrote:
If however you are using a PIC with the I2C peripheral,
you have a problem, since this supports 128 byes total in the transfer
(the address byte counts as one, so 127 bytes of data).
The functions abilities were written to support the hardware abilities on
some particular PIC peripherals...


Very interesting -- Is this 128 byte limit a hardware limit? If I was doing polled mode, could I not i2c_read() as much as I wanted? (Assume FORCE_HW rather than bitbanging.)

Or is it a i2c_isr_stat() software limit? I can see that i2c_isr_state() is not set up to handle more than data bytes 0x1-0x7f, but if you write past that, I don't know what happens.

Time to do some more testing...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group