Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:47 23 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 to RS232

Author Message
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 04:12am 02 Aug 2011
Copy link to clipboard 
Print this post

Now we have I2C communications, anyone know of a convertor/chip/circuit that can be used to get RS232 comms?

I ask as I have a plasmatronics PL20 solar regulator and the RS232 interface, and have managed to get all the tech details (source code etc) for their PLCOMM program. So I am thinking I could program the maximite to 'talk' to the PL20 and act as a real time datalogger instead of using a PC.

any input would be greatly appreciated.

Regards

Terry
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 04:39am 02 Aug 2011
Copy link to clipboard 
Print this post

Hi Terry

You could use a PicAxe chip to convert I2C to RS232 and back. Have you used the PicAxe chips before?

I think Geoff will be adding RS232 to the Maximite in time.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Gadget
Regular Member

Joined: 22/06/2011
Location: Australia
Posts: 70
Posted: 04:41am 02 Aug 2011
Copy link to clipboard 
Print this post

I should have thought of that, I have a few PicAxes at home

Thanks for the hint Glenn
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 04:52am 02 Aug 2011
Copy link to clipboard 
Print this post

  Gizmo said   Hi Terry

You could use a PicAxe chip to convert I2C to RS232 and back. Have you used the PicAxe chips before?

I think Geoff will be adding RS232 to the Maximite in time.

Glenn


I know Stuart was chasing some I2C to UARTs, several have spoken about using a cheap pic chip programmed to suit, and the PicAxe is possibly a solution that will do the job.

Yes Geoff will have it working eventually, but like I2C, I'll bet users will find a solution first.

After all, why not have several UARTs. There will be an eventual call for them.

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

Senior Member

Joined: 25/06/2011
Location: United States
Posts: 143
Posted: 05:31am 02 Aug 2011
Copy link to clipboard 
Print this post

I have a pic version using a pic12f1822 about done just need to test some more.
its a cheap 8 pin part and you can change the i2c address on it and have multiple of them on the i2c bus.
will be able to do handshake hardware and software and also rs485 with 9 bit addressing .
hope to have the source up this week ..
then after that will have a onewire version
ken
Edited by ksdesigns 2011-08-03
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 06:02am 02 Aug 2011
Copy link to clipboard 
Print this post

  ksdesigns said   I have a pic version using a pic12f1822 about done just need to test some more.
its a cheap 8 pin part and you can change the i2c address on it and have multiple of them on the i2c bus.
will be able to do handshake hardware and software and also rs485 with 9 bit addressing .
hope to have the source up this week ..
then after that will have a onewire version
ken


Nice Ken,
A buck a chip pretty much in reasonable quantities, or $1.20USD in one off.

[code]
Enhanced Mid-range Core with 49 Instruction, 16 Stack Levels
Flash Program Memory with self read/write capability
Internal 32MHz oscillator
Integrated Capacitive mTouch Sensing Module
Data Signal Modulator Module
MI2C, SPI, EUSART w/auto baud
ECCP (Enhanced/Capture Compare PWM) Module
Comparator with selectable Voltage Reference
4 Channel 10b ADC with Voltage Reference
25mA Source/Sink current I/O
Two 8-bit Timers (TMR0/TMR2)
One 16-bit Timer (TMR1)
Extended Watchdog Timer (EWDT)
Enhanced Power-On/Off-Reset
Brown-Out Reset (BOR)
In Circuit Serial Programming (ICSP)
On Board In-Circuit Debug
Wide Operating Voltage (1.8V – 5.5V)
Low Power PIC12LF182x variants (1.8V – 3.6V)
Standby Current (PIC12LF182X): 20 nA @ 1.8V, typical
Active Current(PIC12LF1822): 50 uA/MHz @ 1.8V, typical
[/code]

[code]
Parameter Name Value
Program Memory Type Flash
Program Memory (KB) 3.5
CPU Speed (MIPS) 8
RAM Bytes 128
Data EEPROM (bytes) 256
Digital Communication Peripherals 1-A/E/USART, 1-MSSP(SPI/I2C)
Capture/Compare/PWM Peripherals 1 ECCP
Timers 2 x 8-bit, 1 x 16-bit
ADC 4 ch, 10-bit
Comparators 1
Temperature Range (C) -40 to 125
Operating Voltage Range (V) 1.8 to 5.5
Pin Count 8
XLP Yes
Cap Touch Channels 4
[/code]

Will it do the dishes?

Cheers Don...Edited by donmck 2011-08-03
https://www.dontronics.com
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 09:36am 02 Aug 2011
Copy link to clipboard 
Print this post

then after that will have a onewire version

Yippie DS1820B here we come


John
 
stuarts

Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 199
Posted: 09:39am 02 Aug 2011
Copy link to clipboard 
Print this post

I have some 16is740's (single uart) that I am intending to get up and running. there are also the 16is750/752/760 that are dual uarts. they have dual address lines so you could have 4 of them running, therefore 8 rs232 ports.

Just been a bit tied up at work and had to put it on the backburner. then the burner went out.

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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 08:40am 05 Aug 2011
Copy link to clipboard 
Print this post

There must be a chip in the Microchip or other library that has I2C, serial, PWM and SPI. With just a little programming it could act as an I2C slave and receive commands to control the serial, PWM and SPI peripherals.

It would be the magic Maximite peripheral... want 3 PWM? Just add 3 of these chips.

All it needs is the firmware?
Does anyone have the spare time?

Geoff
Geoff Graham - http://geoffg.net
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 02:05pm 05 Aug 2011
Copy link to clipboard 
Print this post

  Geoffg said   There must be a chip in the Microchip or other library that has I2C, serial, PWM and SPI. With just a little programming it could act as an I2C slave and receive commands to control the serial, PWM and SPI peripherals.

It would be the magic Maximite peripheral... want 3 PWM? Just add 3 of these chips.

All it needs is the firmware?
Does anyone have the spare time?

Geoff


This is a great idea. The chip must be a 5V one for easy interfacing. But I propose to be interfaced with Maximite via serial UART at 115200 bps. Then, a command protocol can be implemented, as in UBW or Firmata (or just use an adapted version of UBW firmware for serial instead of USB).
It can be PIC18F25K22/PIC18F45K22 (PIC18F26K22PIC18F46K22 are not yet easily obtained) for a speed of 16MIPS. But maybe there are cheaper alternatives...

This way, Maximite I/O can be reserved for the computer own use (extra RAM memory, etc.)

Vasi

---------------
But Maximite already use SPI bus and if we connect the additional micro there, it will require only one pin instead of two, without changing the hardware dramatically. In fact, will require only additional connectors and without implementing the serial comm.Edited by vasi 2011-08-07
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 11:18pm 05 Aug 2011
Copy link to clipboard 
Print this post

  vasi said  
---------------
But Maximite already use SPI bus and if we connect the additional micro there, it will require only one pin instead of two, without changing the hardware dramatically. In fact, will require only additional connectors and without implementing the serial comm.


Are we after a $1 solution that will give us what we want, and not change the hardware at all?

I'm not sure I am following you 100% Vasi. If MM-Basic is already using SPI, then we would have to do hardware changes to be able to use it?

[code]
Options

SPI is already being used, and would require hardware and software changes.

Serial Uart is already being used and would require hardware and software changes.

I2C is a 2 wire system that MM-Basic already controls, and it appears on the 20 pin bus.

Is I2C lacking in speed when compared to SPI or serial?
[/code]

What Geoff said seems to make sense to me. Many people are working on simple solutions to convert from I2C to whatever it is they need.

If a $1 micro is all that is standing in the way, why not look seriously at this solution if speed isn't a problem.

After all, we could throw an $8 PIC32 micro at the problem, and have it all duplicated again.

I can imagine the I2C pins running around an external board to various slave devices, with level conversion if needed, such as 232, 485, and suitable connectors attached. This could be a shield type device, or a parallel bus board.

Would be nice if the board was also a PIC programmer for the 8 pin devices.

Cheers Don...



https://www.dontronics.com
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 11:38pm 05 Aug 2011
Copy link to clipboard 
Print this post

I see a market for this sort of thing ( hint hint Don ).

I had a play around with using I2C from the Maximite to talk to a PicAxe in this thread http://www.thebackshed.com/forum/forum_posts.asp?TID=3843&PN =2, with the intention of adding features, especially PWM and Serial, to the Maximite. It worked fine, but you still need to program the PicAxe chip, and you need to download the PicAxe editor to do that. Plus a PicAxe is worth more than its bare bones chip.

If someone could supply PIC chips pre-programmed to act as a I2C slave with various outputs, I think they would sell. A single 8pin chip ( not that surface mount stuff, too hard to use for average Jo ) could have a couple of functions, like a pin for PWM, one for Serial, one for Servo, etc.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 11:50pm 05 Aug 2011
Copy link to clipboard 
Print this post


Simple 8 pin DIP chips, was the way I saw it too Glenn.

I also saw an I2C clock and battery backup on the board, as this is a trivial device.

I also see other stuff, but it hinges on coming up with a common chip (if possible) that will do everything required, and the hex code to do the magic.

And maybe an on board programmer so that users can knit their own. I assume the hex code will need ID addressing of some sort.

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

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 01:41am 06 Aug 2011
Copy link to clipboard 
Print this post

Well, I understand UART is out of question...
I thought at an 18F 28-40pin microcontroller included inside, connected on an already occupied/used bus (SPI), letting Maximite connector(only one pin from there used as Chip Select for microcontroller - don't know if Maximite have free unused pins not available on connector) and I2C free for other uses, and providing additional functionality and free pins (parallel port output, PWM, ADC, etc.) on another extension connector.

Anyway, bad idea... unwanted complications...

Vasi
Hobbit name: Togo Toadfoot of Frogmorton
Elvish name: Mablung Miriel
Beyound Arduino Lang
 
jebz

Regular Member

Joined: 13/06/2011
Location: Australia
Posts: 79
Posted: 06:36am 16 Aug 2011
Copy link to clipboard 
Print this post

  ksdesigns said   I have a pic version using a pic12f1822 about done just need to test some more.
will be able to do handshake hardware and software and also rs485 with 9 bit addressing .
hope to have the source up this week ..
ken


Have you coded any pic12f1822 with i2c to serial or other functions you can share?
 
Print this page


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

© JAQ Software 2024