compatibility between servo and i2c ?

jyb

Senior Member
hi all
i need help .i am using a 28x2 for driving 8 servos on port b and a ultrasonic radar sfr10
here is joined a part of the program
this program is just for testing the sfr10 and it runs correctly at all speed/frequencies 4mhz to 64 mhz but if i insert only one "servo B..." command anywhere in the loop, it will stop ,it seems an uncompatibility between servo commands and i2c commands
somebody experimented that ?
 

Attachments

westaust55

Moderator
Please read PICAXE Manual 2 page 258 Appendix 4 - Possible Conflicting Commands

In summary:

Some PICAXE functions make use of internal event based interrupt tasks to
process correctly. Internal event tasks temporarily ‘pause’ the main program
processing to process the task as and when it occurs.

This system can cause potential issues on timing sensitive commands such as those using serial or one-wire communication.

The SERVO command uses Timer 1 & 2 interrupts


Other timing commands (e.g. count, pulsin, pulsout etc.) do not disable the interrupts, but, if active, the hardware interrupt processing time may affect the accuracy of these commands when they are processed.
 

jyb

Senior Member
thanks westaust55

i suspected something of that kind and you give a confirmation
does it means i can't use an interrupt solution to use i2c command's at the same time that servo's commands, because yet used by servo's commands ?
what i would is to make measure of distances and from values obtened,act on servo state (for control a vertical fly altitude)

many thanks for your help
 
Top