Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:38 28 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 LCD

     Page 2 of 4    
Author Message
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 11:02pm 06 Jan 2014
Copy link to clipboard 
Print this post

Hi Mobi,

The master/slave at the same time is standard operating mode for the arduinos. I was a bit surprised by it, but it works great. Not enough knowledge and expertise to get that to work on a pic though.

The PIC16F1503 is the minimum that is needed to connect a standard character LCD, and still have some inputs left for some buttons (even touch sensitive ones).
There was not a very specific reason as many other PIC would work also. I got them at a good price and they were in stock. It seems a nice little chip for all round purposes with lots of extras.
I also like the power range of 2.3v to 5.5v, fixed voltage range for ADC etc.
It also has two CLCs.
http://www.youtube.com/watch?v=FUcDBywCtDA
Very nice to have when you need a logic port (AND,NAD,OR, even D and JK flip flop) but don't want an extra chip. Integrated temperature to measure the die temperature.

The Complementary Waveform Generator (CWG) Module
http://www.youtube.com/watch?v=LKAi2gHRFN4
and Numerically Controlled Oscillator (NCO)
http://www.youtube.com/watch?v=p4FY9XjpTOo
sound interesting and needs some playing around with. :)

For small modules the number of pins are i think adequate. Also the availability as a PDIP, SOIC, TSSOP or QFN helps to use it in different settings.
For the purposes i intend to use them, like keyboard, joystick, relays, temp sensors, servo, steppers, etc it seems to fit nicely. It would also allow me to get more experience with a specific chip and hopefully :) get good at it.
Edited by TZAdvantage 2014-01-08
Microblocks. Build with logic.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 12:11am 07 Jan 2014
Copy link to clipboard 
Print this post

  Quote  The master/slave at the same time is standard operating mode for the arduinos. I was a bit surprised by it, but it works great. Not enough knowledge and expertise to get that to work on a pic though


It is something I have not used either as in all my applications, I have never had a need for more than one master and a paddock full of slaves.

One thing I like about the 1503 is the DAC function - not a feature of earlier PICs. Also the ability to save and restore key registers on entering and exiting interrupts.

Do you have a "list" of i2c devices you would like to create?

David.Edited by MOBI 2014-01-08
David M.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 02:20pm 07 Jan 2014
Copy link to clipboard 
Print this post

  MOBI said  I am more than happy to do a thread on i2c if there is enough interest or following.

Just being able to address around 127 different devices on two pins is awesome.


I'd read it.

I HAVE played with I2C, but only on the PICAXE. I have not touched I2C on the MM, but it could well be worth learning that.

I too agree about having all those devices on one bus - that is a very attractive concept, yes.

Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:42pm 07 Jan 2014
Copy link to clipboard 
Print this post

  grogster said  I'd read it.


OK, that is enough interest, I'll do it but it will be pretty basic to start with.

Big question, do you have the facilities to programme a PIC (PicKit3 or Silicon Chip programmer etc)? Its all very fine to be able to write the i2c slave software but useless unless you can give a PIC an intravenous injection.
David M.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 12:50pm 08 Jan 2014
Copy link to clipboard 
Print this post

I only have the PICAXE programming thing. Both USB and plain serial cables, but not the PicKit3 unit.

I would have thought that your I2C thread would be more general-purpose instructions and tutition on how to use I2C devices more then needing to direct-inject the PIC chip?

...i may have misunderstood your intentions with the I2C thread though...

I don't have a PicKit, but plenty of others will have, so I am sure that whatever the case, the thread would be useful for us all.
Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:24pm 08 Jan 2014
Copy link to clipboard 
Print this post

  Grogster said  I would have thought that your I2C thread would be more general-purpose instructions and tutition on how to use I2C devices more then needing to direct-inject the PIC chip?

...i may have misunderstood your intentions with the I2C thread though...


If I did an i2c "how to" thread, it fit in one post as i2c use is pretty basic.

My main aim is to show people how to turn any function into an i2c compatible device/module. Also how to turn any MCU into an I2C master using firmware.
David M.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:36pm 13 Jan 2014
Copy link to clipboard 
Print this post

@ TZAdvantage,

I have got one each of the data expander and PIC1503 you sent fitted to an adapter board so that I can plug into a bread board for testing. Photos show I was a bit heavy on the tin paste but at least there won't be any cracks in the tracks.

I'll start with the data expander first run off the MM I2C bus and then work on the translation of the F88 to F1503. It is going to be 40C+ for the next couple of days and too hot now to work outside although the back shed is double leaf masonry and a lot cooler than outside.

Anyway, it will be a chance to sit back and relax a bit and see if I can get the grey neurons working.



Thanks again Downwind for the SMD vise tool.Edited by MOBI 2014-01-15
David M.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:30pm 13 Jan 2014
Copy link to clipboard 
Print this post

Handy little adapter boards, they look good, and a bit extra tin doesn't hurt.
Even with some source code as a background. :)

Here it is 'winter' and about 25C. I am working like crazy to get the MakerSpace ready, as Wednesday evening we will have our first meeting. Lower temperature and humidity is a blessing.


Microblocks. Build with logic.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:31pm 14 Jan 2014
Copy link to clipboard 
Print this post

Drat!

I made the data expander adapter board one row of holes too wide so it will plug into the bread board but I can't access one row of pins. Never mind, I have plenty of MM, MF and FF jumper leads. It just makes the set up a bit messier. I should be used to that by now

I think I have the I2C PIC16F1503 code done. It compiles (assembles) but doesn't mean that I have got it right. Suck it and see? Need to get the expander going first.
Edited by MOBI 2014-01-16
David M.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 05:37pm 14 Jan 2014
Copy link to clipboard 
Print this post

What about if you just plug one row into the outer hole row and the other into another breadboard? That's easy and keeps the proto-ing reasonably neat.

 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 05:54pm 14 Jan 2014
Copy link to clipboard 
Print this post

  paceman said  What about if you just plug one row into the outer hole row and the other into another breadboard? That's easy and keeps the proto-ing reasonably neat.


Yes, that is an option, but it is just as easy to turn the board upside down and plug the leads on the "top"




The ankle bone's connected to the leg bone.....the....

The MM i2c is connected to a two row i2c bus which is connected to peripherals. The bus is connected to the bread board which is connected to the expander adapter board. It is all a bit fuzzy (focus and explanation), but it is working. The LED display was for getting the bus working and connected right as I knew it worked.

There seems to be a million and one instructions for this 16 bit expander. I'll work on getting a basic "blink a led" first.



David M.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 07:47pm 14 Jan 2014
Copy link to clipboard 
Print this post

I was getting excited there - for a moment I thought for the first time we might have the word "thigh" mentioned on the forum
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 08:05pm 14 Jan 2014
Copy link to clipboard 
Print this post

Thigh.
Smoke makes things work. When the smoke gets out, it stops!
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 08:45pm 16 Jan 2014
Copy link to clipboard 
Print this post

Hmmm.. my last post went missing.

i2c expander update. Not going well.

The logic analyser and MM.I2C all say it is working and in fact most of the commands do what they are supposed to except for reading the input pin data.

There are two 8 bit ports that can be configured (software) as individual or combined dependent on a bank select bit. Things get tricky here because the 22 or so internal registers all get different addresses if you change between bank 1 or 2. I must admit, this is the first i2c device that has me "temporarily" stumped.


The protocol description looks normal but outcome is not. It seems to be reading the register address and not the contents of the register, nor is it stable. Another example of Microchip data sheet ambiguity.

I keep plugging on...not ready to quit just yet.
David M.
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 01:36pm 17 Jan 2014
Copy link to clipboard 
Print this post

Interesting reading gents...

Has anyone considered using the Spankin new uMite to do I2C frontend sensor work..?
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:49pm 17 Jan 2014
Copy link to clipboard 
Print this post

  zonker said  Has anyone considered using the Spankin new uMite to do I2C frontend sensor work..?


That is my intention when I get this data expander and PIC16F1503 translation out of the way.
David M.
 
Zonker

Guru

Joined: 18/08/2012
Location: United States
Posts: 761
Posted: 02:08pm 17 Jan 2014
Copy link to clipboard 
Print this post

Sweet..! I am planning to use the uMite to read temp, voltage and RPM data...
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 02:40pm 17 Jan 2014
Copy link to clipboard 
Print this post

Hi Zonker

Were you planning on using the uMite as a I2C master or a slave?

If you are planning on making it a slave, I think you can build in all the i2c functions into one slave and use a control byte to determine what input you are reading.
David M.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 03:00pm 17 Jan 2014
Copy link to clipboard 
Print this post

Browsing the web shows that many others have had problems with the Microchip data expander data sheet.

Anyway, the I/o pins do what they are supposed to on output but I don't think the unit likes floating input pins even though it has switchable weak pull ups fitted.
Half way there. I have a led flashing. Wow

Bread board starting to get a bit cluttered.
David M.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 12:42am 18 Jan 2014
Copy link to clipboard 
Print this post

Once you get a led flashing, you are on your way. :)
Often it is not the I2C that is difficult but the commands and registers that chips use.
Using a uMite would not make that part any easier i am afraid, although using MMBasic will make a edit/test cycle more quick.

Microblocks. Build with logic.
 
     Page 2 of 4    
Print this page
© JAQ Software 2024