Some questions about MAXIM ICM7212
jordan2003
Posts: 6
Ok,
I have been working with the propeller for a few weeks now and have started to get a grip on the spin language. I have interfaced the 4X4 Membrane Keypad, lit a billion leds up with patterns, created tables, calculations, timed events, timers, a servo interface, and a bunch of other. etc. etc.. etc...
I wanted to try interfacing to an IC so I looked through the MAXIM free samples and ordered a few different types of chips from led drivers to 4 digit 7 segment decoders. I looked at all the specs on all the chips and decided the 7212AM would be a good starting point as it is microprocessor controlled and didn't require a lot of wiring.
My questions is about how data is moved into the data inputs and how the timing of the CS1 and CS2 pins.
Looking at the datasheet and the specs, I thought that maybe I understood how it worked but after hooking it up and writing some code, i realized what i was doing was just shot in the dark.
I am so new I'm embarrassed to even show my code but basically i used 4 pins for the B0 thru B3 and connected them to P16 thru P19. These pins were set to the digit i wanted to display and then had two pins on the propeller control DS1 and DS2 for the digit select. I had two more pins on the propeller hooked up to CS1 and CS2 and would set both low(I thought that would load the pin data from the 6 pins. and then pulsed CS1 or CS2 high to display the digit number on a single 7 segment display. I only hooked up b1, b2, b3, b4,b5,b6,b7 so as to keep the wires to a minimum.
Do i go straight from propeller pins to the ICM7212 pins?
If so, do i set them high and low to set what the B0-3 and DS1/DS2 data bits should be?
Do I take CS1/CS2 low to load the Data/DigitSelect and then pulse CS1 or CS2 high(whichever is required via the datasheet truth table)?
If so, does pulsing CS1 for 200 MicroSeconds verses 1 MilliSec make a difference?
Am i close or are you sitting back laughing your butt off? :-)... lol....
Anyways, I think I may be doing this totally wrong and any help would be greatly appreciated.
I hope that understanding this one will help me in the future with more complicated chips.
Thanks,
A VERY INTERESTED NEWBIE!
Jordan
I have been working with the propeller for a few weeks now and have started to get a grip on the spin language. I have interfaced the 4X4 Membrane Keypad, lit a billion leds up with patterns, created tables, calculations, timed events, timers, a servo interface, and a bunch of other. etc. etc.. etc...
I wanted to try interfacing to an IC so I looked through the MAXIM free samples and ordered a few different types of chips from led drivers to 4 digit 7 segment decoders. I looked at all the specs on all the chips and decided the 7212AM would be a good starting point as it is microprocessor controlled and didn't require a lot of wiring.
My questions is about how data is moved into the data inputs and how the timing of the CS1 and CS2 pins.
Looking at the datasheet and the specs, I thought that maybe I understood how it worked but after hooking it up and writing some code, i realized what i was doing was just shot in the dark.
I am so new I'm embarrassed to even show my code but basically i used 4 pins for the B0 thru B3 and connected them to P16 thru P19. These pins were set to the digit i wanted to display and then had two pins on the propeller control DS1 and DS2 for the digit select. I had two more pins on the propeller hooked up to CS1 and CS2 and would set both low(I thought that would load the pin data from the 6 pins. and then pulsed CS1 or CS2 high to display the digit number on a single 7 segment display. I only hooked up b1, b2, b3, b4,b5,b6,b7 so as to keep the wires to a minimum.
Do i go straight from propeller pins to the ICM7212 pins?
If so, do i set them high and low to set what the B0-3 and DS1/DS2 data bits should be?
Do I take CS1/CS2 low to load the Data/DigitSelect and then pulse CS1 or CS2 high(whichever is required via the datasheet truth table)?
If so, does pulsing CS1 for 200 MicroSeconds verses 1 MilliSec make a difference?
Am i close or are you sitting back laughing your butt off? :-)... lol....
Anyways, I think I may be doing this totally wrong and any help would be greatly appreciated.
I hope that understanding this one will help me in the future with more complicated chips.
Thanks,
A VERY INTERESTED NEWBIE!
Jordan
Comments
Yes, you can go straight to from the prop pins to the ICM7212 pins. You can operate the ICM7212 from 3V3 (same as the prop) or 5V.
Set the 8 prop pins to outputs. Set the 4 data bits to whatever you require ($5 is a good test value) and set the digit pins both 00 to get the first digit. Now ensure CS1 & CS2 are high and then pulse them both low (both are required to go low at the same time to latch the data/digits) and back high again. 200us is fine as is anything longer than this.
Try to get a digit working first.
BTW Have you set the brightness pin as suggested in the ICM7212 manual?
Posting your code would help us to see what may be wrong. Goto the "Go Advanced" section and use the post code tags to keep the formatting of your program correct, or attach the program as a zip file (use the prop tool to save all the code).
first of all welcome to the propeller-forum.
You have posted a well written posting. You wrote what your actual understanding of sending data into the MAX7212-chip is.
And in most things you are right. There is still room to improve your posting style. If you attach the datasheet as a PDF or add a link from where the datasheet is directly downloadable
you make it comfortable for others to take a look into the datasheet.
I took the effort to search for the datasheet myself.
Now no direct answers but guiding questions:
which figure in the datasheet shows the trueth-table for the subtype 7212AM?
on which signal and logic voltage level will the data be stored into the 7212AM?
To find out how it works, as data I would use the 8 that lights up every segment and then
check the voltages of every of the 4 digits. This makes sure that any chosen segment A-F will
change the voltage and you only have to check four outputs f.e. A1, A2, A3, A4 to see which digit
got the data.
Another thing: if somebody would laugh about your assumptions he would have a big GAP
in his personal development or to say it positive a big potential of characterical improvement.
In this forum there is only a very small number of "login-IDs" that - in seldom cases tend to laugh or joke
about postings. 99.8% is polite and patient.
So take a look into the datasheet and come back with new questions.
Even if your code would look like a mess this is good information, because I would like to make suggestions on how code can be written to be easy to understand and easy to maintain.
keep the questions coming
best regards
Stefan
http://datasheets.maxim-ic.com/en/ds/ICM7211-ICM7212.pdf
And here is my code. >>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have included a picture of my hookups. I have two leds that comes on almost every time I power up and my hand running across wires does crazy things to the leds. they light up and go out randomly. I literally can touch the wires on the plastic and that led will turn off and when i run the spin file, it will kick on every time it's supposed to transfer data. then i have to touch the wires and those leds that lit will go out. If at least the right leds turned on every time i would have something to work with and maybe figure out whats going on. I even took all 8 DS, CS and B0-23 wires off and just had ground, brightness input, and 3V hooked up and leds still come on. If i reload the spin file it does kick leds on for a blink but like i said, a few leds just stay on.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have included a picture of my hookups. I have two leds that comes on almost every time I power up and my hand running across wires does crazy things to the leds. they light up and go out randomly. I literally can touch the wires on the plastic and that led will turn off and when i run the spin file, it will kick on every time it's supposed to transfer data. then i have to touch the wires and those leds that lit will go out. If at least the right leds turned on every time i would have something to work with and maybe figure out whats going on. I even took all 8 DS, CS and B0-23 wires off and just had ground, brightness input, and 3V hooked up and leds still come on. If i reload the spin file it does kick leds on for a blink but like i said, a few leds just stay on.
Anyways, thanks for the help already.
Jordan
Next, You do not have the second set of prop power and ground connected. This is a receipe for killing your PLL in the prop. All power and ground pins MUST be connected (you are missing the pair between the xtal). You should have some bypass capacitors as well. Best to bring the 3v3 and gnd to one set of rails on your patchboard as you can then place some caps on it. For your experiments, a 10uF tantalum placed at the top edge where the power comes in from the other pcb/source, and then at least one 100nF (0.1uF) per IC will surfice.
When you post your code, you need to place it between code tags {code} ..... {/code} (replacing "{" and "}" with square brackets, or used the advanced reply. This preserves the indentation of your code. Otherwise we may miss something.
the PCB next to the bredboard is a basic-stamp. basic-stamps work with 5V.
So my question is do you supply the propeller with 5V or with 3.3V???
The propeller is a 3.3V device. The propeller is quite robust but as Chip Gracey mentioned in the "how to safely interface a 5Vdevice".
The CMOS-material with wich the propeller is manufactured is rated for a maximum voltage of 3.6V.
keep the questions coming
best regards
Stefan
Jordan
10kOhm---x---Inputpin
or pull-down-resistors GND
10kOhm---x---Inputpin
at "x" you connect the output-pin of the propeller-chip. If the input is left free flowing even a 1 inch cable acts as an antenna and the all over EMV-noise is enough to trigger the input
because the input-resistance is very high 1 MOhm or more.
The pull-up/pull-down-resistor reduces the input-resistance and the +3.3V o the 0.0V are "stronger" than the EMV-noise. Through the resistor the voltage is kept on 3.3V or 0.0V.
With a pullup-resistor If the Prop-output goes down to 0.0V the input goes down too (all the 3.3V drop across the 10kOhm.
With a pull-down-resistor if the prop-output goes high to 3.3V the input goes high too ((all the 3.3V drop across the 10kOhm but on the "x"-side there is still 3.3V
As long as you drive low currents 1-20mA the LED-resistor thing will be working somehow. For bigger currents it is not suitable. As you have several LEDs in the circuit they might already need too much current.
I recomend using a fixed voltage-regulator (VR) of 3.3V
or an adjustable voltage-regulator like the LM317 1A -if you have on of these handy.
If you happen to have an OP-Amp like the LM358, LM324, LM339 or something similar
this could act as a low-power-voltage-regulator too (20 mA) (voltage-follower) with a voltagedivider at the input.
Best thing is a fixed VR with 3.3V
Disconnect the propeller-chip.
Then to learn about the behaviour of circuits you could simply measure voltage and current of the LED-resistor while drawing different currents through different load-resistors.
If you want to learn about the basics of electronic I would recomend a website like http://openbookproject.net//electricCircuits/DC/index.html
keep the questions coming
best regards
Stefan
I have used diodes as (almost) constant-voltage-droppers for discharging accumulators but the idea didn't come up to my mind in this case
best regards
Stefan