Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:07 22 Nov 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 : I2C serial and expansion

Author Message
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 07:46am 29 Jun 2011
Copy link to clipboard 
Print this post

I think for a lot of the parallel applications a PFC8574 I2C expander would be good. A whole byte can be output at once. The addressing on I2C allows many PFC8574s to exist on the same bus for display, keyboard and other I/O. A DS1307 on the same I2C bus would allow maintenance of the time even with power breaks.

The stamp has a number I2C modules that can be plugged on with little difficulty. The syntax used seems quite clear and usable -
I2CIN 1, 80, [A]
I2COUT 1, 80, [C]
Variables A&C can even be strings like you'd send to a LCD display.

Don's got a heap of PFC8574s in stock.

interesting, can't use [B ] it's bold
 
rhamer
Senior Member

Joined: 06/06/2011
Location: Australia
Posts: 174
Posted: 08:19am 29 Jun 2011
Copy link to clipboard 
Print this post

  jebz said   I think for a lot of the parallel applications a PFC8574 I2C expander would be good. A whole byte can be output at once. The addressing on I2C allows many PFC8574s to exist on the same bus for display, keyboard and other I/O. A DS1307 on the same I2C bus would allow maintenance of the time even with power breaks.

The stamp has a number I2C modules that can be plugged on with little difficulty. The syntax used seems quite clear and usable -
I2CIN 1, 80, [A]
I2COUT 1, 80, [C]
Variables A&C can even be strings like you'd send to a LCD display.

Don's got a heap of PFC8574s in stock.

interesting, can't use [B ] it's bold


I thought about that kind of approach to get really low speed serial.

You set 8 bits then clock them out with another line. Then do the reverse for the other direction. The off board device (probably another PIC) would buffer it and handle the real serial.

Takes heaps of I/O lines and I could probably write faster, but better than nothing.

Anyway, hopefully it won't come to that, and Geoff the Genius can figure it out.

Regards

Rohan
Rohan Hamer
HAMFIELD Software & Hardware Solutions

Makers of the Maximite Expander.

http://www.hamfield.com.au
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 09:18am 29 Jun 2011
Copy link to clipboard 
Print this post

I've currently got 2 DS1631Z thermometer chips running on my maximite. The I2C has been bitbanged using basic. Its not really fast, actually its quite slow. But it is working.
I've looked at a Philips I2C UART that emulates a 16C450 UART. I has 64 bytes of FIFO for send and receive. Just haven't bothered to find one yet. At the speed that I can get with I2C from basic, it would only allow very low speed comms.

The other IC I've been looking at is the Maxim DS2482 I2C to 1wire bridge. The timings on 1wire are way too tight to do from basic, but the bridge will allow 1wire to be run from I2C.

I've previously used the SN8574 to provide button and led from I2C as well as driving 16x2 LCD from I2c. It's a great way to provide remote I/O.

Next on my list is an RTC. I have several different ICs from different vendors, its just a matter of deciding which one to use.

The difficulty is that while the I2C protocol is nicely defined, every different I2C IC needs different requirements. Some just want a device address and a command byte, some need device address, command, address within the device and data either send or received. Its not just as simple send a byte to the device.

I've worked with several basics that made assumptions like the I2C device is a memory and therefore wanted addresses and data supplied when I just had to send one byte to a register.

At the moment the code I have is rough and tied to the DS1631. I'm hoping that I can clean it up and make it easily usable on any pins on the expansion connector. I'll then release it for anyone to use as it seems it might be a while before I2C is natively supported on Maximite.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 09:33am 29 Jun 2011
Copy link to clipboard 
Print this post


Code:
[code]
I2CIN 1, 80, [A]
I2COUT 1, 80, []
[/code]

Bold:

I2CIN 1, 80, [A]
I2COUT 1, 80, []


Italics:

I2CIN 1, 80, [A]
I2COUT 1, 80, []


Underline:

I2CIN 1, 80, [A]
I2COUT 1, 80, []


I'll bet you can't use I and U in square brackets either Stuart.

Cheers Don...

https://www.dontronics.com
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 09:49am 29 Jun 2011
Copy link to clipboard 
Print this post

Don, I cant say I've tried....


Stuart
Time is nature's way of keeping everything from happening all at once.
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 09:57am 29 Jun 2011
Copy link to clipboard 
Print this post

  stuarts said   Don, I cant say I've tried....


Stuart


IC said the semiconductor manufacturer.

Cheers Don...
https://www.dontronics.com
 
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 12:59pm 29 Jun 2011
Copy link to clipboard 
Print this post

  stuarts said  I've looked at a Philips I2C UART that emulates a 16C450 UART. I has 64 bytes of FIFO for send and receive.


I think we'll need the I2C UART as at least one part of each pair of asynchronous serial I/O pins are in use. There's PIC pins 43,44 or on Maximite expander pins 21,19 free for I2C though.
.
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 04:22pm 29 Jun 2011
Copy link to clipboard 
Print this post

Jebz, I was looking at that yesterday. At least there are both of the I2C pins available. Unfortunately there aren't a TX and RX for conventional serial comms. Until Geoff can get some firmware based I2C, it does work by bitbanging from basic. Its just slow.

Stuart
Time is nature's way of keeping everything from happening all at once.
 
Print this page


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

© JAQ Software 2024