Hi Joep, Thanks again for your investigation ! I tried your master & slave, works nice ! I then kept your master, and modify my slave: remove serial_hw_write, put a OSCCON_IRCF = 7: works. Then remove OSCCON_IRCF = 7 (no serial_hw_write): works...
So the problem really comes from my serial_hw_write calls (this is one of my speciality: I consider them as just some debug statement without even the slightest impact on timing etc... :)). Question: why not setting OSCCON_IRCF = 7 makes the slave works ? Seems to be the default value, at least for me ! Re-thinking about the problem, I use tiny bootloader for my 16f88s. The tinybl configuration (the file used) specifies internal osc @8MHz and serial @19200bds. Could it be possible that tinybl sets IRCF = 7, and this values is kept by the PIC as the default ? Thanks again ! Seb Le Monday 22 December 2008 23:07:20 Joep Suijs, vous avez écrit : > Just had an other look at your slave code. > If it runs properly and only has the speed problem, try to remove the > serial calls or put them at the end of the procedures, not at the > start. Iirc, it is time-critical to respond to some of the interrupts. > > Please let me know how you intend to proceed with your i2c slave. > I could port my code to jallib when I put the user code in a call-back > procedure. > The only downside of my lib is that it can't handle a write string > (not followed by a read), since there seems no interrupt on stop or > restart.. > > Joep > > 2008/12/22, Joep Suijs <[email protected]>: > > 2008/12/22, Sebastien LELONG <[email protected]>: > > > > It is. But intosc is not fed into the cpu (see figure 4-6) > > > > > > Reading this diagram (I'm not an expert, this kind of diagram burns my > > > brain...), I understand IRCF = 0 with INTOSC is not possible, which is > > > confirmed reading the datasheet: postscaler allows values from 115KHz > > > to 8MHz, not 31.25KHz. > > > > > > Maybe (?) when I set clock to 31.25KHz, it switches to INRC instead of > > > INTOSC... There's no INTRC config in device files. Actually I don't > > > event know the difference between the two. This is out what I can > > > understand :) > > > > I just look at the number in the mux - 000 selects the 31khz which > > comes from the internal osc block. I don't mind that the simplified > > block diagram does not tell me everything ;) > > > > > I also need to check, but 115Kbds serial perfectly works with > > > int...@8mhz and I wouldn't expect it to work @31KHz, so for me by > > > default it really runs @8MHz. > > > > It does not for me... > > Just added checking of 5% error in serial_hw lib and now compilation > > fails at 115k2, 8MHz. 56k2 works fine. > > > > I could not get your code to work at all, so I build the > > simple_i2c_slave with my lib (enclosed). It runs okay now and I can't > > even break it when I delete the content of the delay function - just > > calling it seems enough. > > > > I enclosed the code (add a board file for the i2c_master) > > > > Joep > > -- Sébastien LELONG http://www.sirloon.net http://sirbot.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jallib" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jallib?hl=en -~----------~----~----~----~------~----~------~--~---
