Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 13:45 20 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Thoughts on I2C emulation of RS232

Author Message
Ray B
Senior Member

Joined: 16/02/2007
Location: Australia
Posts: 219
Posted: 02:19am 22 Aug 2011
Copy link to clipboard 
Print this post

On the PixAxe Forum last week I put to their boffins the following:

Requirement is to use I2C to emulate RS232-protocol serial with the PICAXE X2.

Basically what I would like to do is communicate from the MaxiMite (which at this stage of development does not have a serial port) to a slave PicAxe or even a network of PicAxes using the only medium available from the MaxiMite which is I2C which has been tested out passing simple bytes to a slave PicAxe.

What is invisaged would require bothways communication, for example the MaxiMite polls the PicAxe asking for a value from a temperature sensor which the PicAxe returns then the Maximite can do something with the data like display on its connected VGA screen. Speedwise even 1200 bps or lower would be usable.

I was hoping someone has an example of PicAxe to PicAxe serial communications through I2C to get me started.

Another possibility would be to use a I2C UART but don't want to resort to that for something that hopefully could be achievable in Basic code.

--- EXTRACT OF RESPONSE -----------
Serial or "RS232" protocol is a layer 1 protocol in the 7-layer OSI (Open Systems Interconnection) model. Layer 1 deals with the basic media, electrical and bit timing of communication. There is no provision for handshaking in layer 1: the sending end trusts that the other end is smart enough to know what to do with any received data.

i2c is a layer 2 protocol - it communicates at a higher technological level. Each node or end of the link has an address and there is a protocol of how the ends share the link and handshake/acknowledge data sent and received.

And there is the problem: the i2c protocol is too sophisticated to simply convert to asynch serial like RS232.

My suggestion would be to use an X1 or X2 series PICAXE (my choice would be the 20X2) configured as an i2c slave to the Maximite and, with some form of scratchpad monitoring, transmit and receive serial data via its hSerial port.

I have done similar things with 40X2 and 28X1 chips in the past. However, my code was purpose built and would not port easily to your application.
----- END OF EXTRACT ----------

Refer to following for full post:
http://www.picaxeforum.co.uk/showthread.php?19167-Using-I2C- for-Serial-Comms

So in summary it sounds like new functions in C Code in MM V2.6 will be required to achieve what a lot of us desire....

Living in hope



RayB from Perth WA
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024