Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20599

BASCOM-AVR : coupling 2 atmega via RS 232 or SPI ? : REPLY

$
0
0
Hi, You need the i2c slave lib (which is a separate product). Simple put when something happens on the i2c bus the lib calls the defined routine (that you write) to handle the action. For example:- [code:1:e8fed973e2] 'Byte received from Master 'Twi holds the value sent 'Twi_btw holds the index Twi_gotdata: ByteFromMaster = Twi 'Receive from master Return 'Master wants byte 'Twi_btr holds the index 'Twi should contain the value to be sent when the callback ends Twi_master_needs_byte: Twi = 1 'Return Byte ' Return [/code:1:e8fed973e2] I would still recommend using an ISR for driving the stepper motors, but it's your choice. Regards Ian Dobson

Viewing all articles
Browse latest Browse all 20599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>