Page 2 of 2

Re: Pin out research thread - comments

Posted: Tue Nov 25, 2008 3:40 am
by jharvey
Alright, I'm a bit confused, plugged vs unplugged, what's plugged and then unplugged?

Some of this can make sense if your not driving pins, they can float to one specific value, then perhaps plugged means you put it in a bread board or some such circuit that has a tendency to pull it on way or the other, changing the readings. I'm not seeing the trees from the forest here.

I was thinking we may want to add a magic decoder ring to the tuner software. Something that can tell us the status of ports and such in a more human readable format. Perhaps something that list portA, pin 1 current status high, set to input, pin 2 status low set to output, ect.

A pile of hex isn't exactly light reading or easy to know what's going on with the IO. I'm reading up / studying the tuner soft, but I don't think I can make a successful attempt at making a decoder ring. Based on how quick sry_not4sale whipped up the hex decoder, I'd bet he can do this in a snap. Is that something that might interest you sry_not4sale?

Re: Pin out research thread - comments

Posted: Tue Nov 25, 2008 6:52 am
by Fred
Yeah, I already talked to him about a potential payload type with reading and control over all the basic IO control registers :-) It would be quite a lot of work in check boxs/gui and a bit at my end too, so there are other priorities. Its icing.

Yes, bread board and not bread board. Whats interesting are those mmc regs! that could mean quite a lot.

Fred.

Re: Pin out research thread - comments

Posted: Sun Dec 21, 2008 2:49 am
by Fred
Nope, still no luck.

Please anyone that has some time, scour the manual trying to find out why those pull up registers might be enabled after reset. I'm lost and it's time for bed.

Fred.

Re: Pin out research thread - comments

Posted: Sun Dec 21, 2008 3:59 am
by jharvey
So let me see if I'm understanding this right. Your measuring port A pins, as either high or low, then reading them via soft, and your not getting the same thing your multi meter is telling you. So you measure it has high, but the soft read claims low. Is that right? Or are you simply trying to figure out what the defaults are, and how the are set.

Re: Pin out research thread - comments

Posted: Sun Dec 21, 2008 4:17 am
by Fred
No, the register and reality agree nicely. All lights light up because it doesn't take saturation to do that. the outputs are at about 0.9v due to weak pull up. the one that is pulled up strongly is at about 4.5v and is the only one shown on the register.

The issue is...

That the pull up is enabled in the first place! It shouldn't be. The default reset value is 0 for the pull up register bit that controls that port. And yet it is set without me setting it, without anything really.

When the Serial monitor runs it's not set. I don't know why there is a diff, but there is one.

I cut down the first release of FreeEMS to do nothing and it behaved the same. I suspect that maybe the SM code resets something and we don't. Still, whatever it is shouldn't need resetting and I want to know why it does.

If you wanna help, look into the docs and try to find out why port S and port A would be pulled up out of reset.

Fred.

Re: Pin out research thread - comments

Posted: Mon Dec 22, 2008 11:04 pm
by davebmw
I found some interesting bits of info around chapter 22 in the datasheet regarding default levels and the addresses that require setting to disable the pull-up devices on all the ports not just A and S.
Here are some highlights copied and pasted from the pdf.
This will probably make little sense without looking at the real datasheet.
Look here:

http://www.freescale.com/files/microcon ... P512V2.pdf


Most I/O pins can be configured by register bits to select data direction and drive strength, to enable and
select pull-up or pull-down devices. Interrupts can be enabled on specific pins resulting in status flags.

0x000C Pull-up Up Control Register (PUCR) Read / Write1 (covers port A I think)

0x024C Port S Pull Device Enable Register (PERS) Read / Write

22.3.2.27 Port S Pull Device Enable Register (PERS)

Read: Anytime.
Write: Anytime.
This register configures whether a pull-up or a pull-down device is activated, if the port is used as input or
as output in wired-OR (open drain) mode. This bit has no effect if the port is used as push-pull output. Out
of reset a pull-up device is enabled.

Figure 22-29. Port S Pull Device Enable Register (PERS)
Table 22-29. PERS Field Descriptions
Field Description
7–0
PERS[7:0]
Pull Device Enable Port S
0 Pull-up or pull-down device is disabled.
1 Either a pull-up or pull-down device is enabled

Hope it helps

Edit there are also registers to select the amount of drive the pins produce. :)

Re: Pin out research thread - comments

Posted: Mon Dec 22, 2008 11:48 pm
by Fred
All true Dave, but if you look below the individual bits, it shows the default value out of reset, and it is zero for port A :-/ Hence I REALLY want to know why ours isn't as I'm not setting it and the cut down 0.0.1 code did the exact same thing!

Thanks for having a read though, I'm sure you found it interesting :-)

Fred.

Re: Pin out research thread - comments

Posted: Tue Dec 23, 2008 12:45 am
by davebmw
Still reading............