Puma board for FreeEMS

Marcos' unmaintained, but still in-use, Puma for FreeEMS circuit board/hardware design!
User avatar
jbelanger
LQFP144 - On Top Of The Game
Posts: 387
Joined: Sat Feb 23, 2008 8:58 pm
Contact:

Re: FreeEMS for Argentina

Post by jbelanger »

nitrousnrg wrote:Do you know if a LM1815 or MAX9926 can handle digital inputs? VR signals are much more tough than 0-5v, or 0-12v square signals. I was wondering if I can use the same circuit to interface VR or Halls.
The MAX9926 can handle digital inputs of either voltage (actually any voltage will work up to what your input components will take). Just connect the signal to one of the differential inputs and leave the other one floating: one input will give one polarity and the other will inverse it.

This is a very nice chip to use for any input that will be used to measure frequency, time interval or to count the number of pulses. That is what I use on my I/O Extender for those reasons.

Jean
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: FreeEMS for Argentina

Post by nitrousnrg »

Cool!
Those are great news Jean, thanks.

I still have to reroute that part of the pcb. Plan A was LM1815, but I only have MAX9926. Its quite a small package...
Marcos
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: FreeEMS for Argentina

Post by jharvey »

nitrousnrg wrote:I checked kicad's footprints against my new, shiny components. So far I can tell my printer is not even close to a 1:1 scale ¬¬
Try printing out a larger image, then scale each axis. For example, in the US we use in, so I print an 8 inch square box, then measure it with a ruler, and adjust the X and Y scale. Lets say X by .85 and Y by .95. Getting this to work on a larger scale tends to work well on a smaller scale as well. Small inaccuracies on the larger scale, will also be small inaccuracies on the smaller parts.

About the max chip, don't forget this is already drawn.

http://code.google.com/p/5554openecu/so ... _crank.sch

Technically it uses a separate HALL input, so not quite what you are looking for, but it does offer modules, symbols, ect that might be handy.
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: FreeEMS for Argentina

Post by nitrousnrg »

aww, I was wrong. I have a few MAX9924. Still applies. (and I drew it a while ago)

About the printer... that was exactly the plan :-) Anyway, the paper-printed board I had was printed at home before the other PC died; and the copy shop, as far I can tell, does 1:1 scales pretty well.

I removed the zeners and caps from the output protection circuits. Too much footprints, and I wasn't going to populate them. I believe a 1k resistor between the cpu and the other IC is enough.

I just created a text file named "FreeEMS hardware specifications", and copied the specs found in http://www.diyefi.org/forum/viewtopic.php?f=9&t=5.
I'll try to modify it according to my board, hoping to get towards a more general specification (the current(?) one is aimed at freeems1.0). Fred, if you already did this, I forgot it.
As I already stated, my board is not intended to be so ultra-flexible (no 4 MAP sensors, for example). Hamster's project is in the same way, I think. The point is, I want to comply to a higher freeems-std.

We could have more than one standard:
For example, a basic one (power, inputs and outputs protection, cpu sleep ability, pinouts, etc), other for flexibility (X amount of conditioning circuits, Y jumpers, Z different sensors), other for diy ease (through hole compatible), or a nuclear blast proof seal.
In that case, I'd aim to be freeems-basic or freeems-safe, hamster could be in the same boat.

It would be an easy way for hw developers to create different variants of freeems, in a supported way.

Its just a thought.
Marcos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS for Argentina

Post by Fred »

nitrousnrg wrote:I removed the zeners and caps from the output protection circuits. Too much footprints, and I wasn't going to populate them. I believe a 1k resistor between the cpu and the other IC is enough.
Might wanna make that 1.6k if you want to be totally safe (then it can handle a short to ground or power with the opposite coming out of the MCU). Good to hear you're ditching those, they were a waste of time anyway.
I just created a text file named "FreeEMS hardware specifications", and copied the specs found in http://www.diyefi.org/forum/viewtopic.php?f=9&t=5.
I'll try to modify it according to my board, hoping to get towards a more general specification (the current(?) one is aimed at freeems1.0). Fred, if you already did this, I forgot it.
Make all the changes you want, and keep me posted and I'll try to get them incorporated into the master document in my repo as quickly as possible. See below about the intent of such a document, though.
We could have more than one standard:
For example, a basic one (power, inputs and outputs protection, cpu sleep ability, pinouts, etc), other for flexibility (X amount of conditioning circuits, Y jumpers, Z different sensors), other for diy ease (through hole compatible), or a nuclear blast proof seal.
I'm not sure that the intent of the standard is clear. I want the standard to encompass required ground/power connections, and some pinouts, and basic cpu protections etc, but little or nothing else. I want maximum flexibility. For example you could have a single cylinder FreeEMS that only provides hardware for a motorbike or lawnmower but is still compliant. I'd like to have some recommendations in place that suggest what sort of minimum equipment should be present for various configurations, etc, but that's just a guide. I'd like to limit people as little as possible.

The main things that I want to achieve are as follows :
  • Device is reliable and robust to a certain degree. (designed to protect the users)
  • Device is 100% compatible with Vanilla software without patching or hacks and all basic software works as is without hacks. (designed to avoid forking of the firmware like msextra/ms-b&g has had and all the associated nightmares)
Other than that, I see no need for a standards document. What are your thoughts?

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: FreeEMS for Argentina

Post by nitrousnrg »

Might wanna make that 1.6k if you want to be totally safe (then it can handle a short to ground or power with the opposite coming out of the MCU). Good to hear you're ditching those, they were a waste of time anyway.
5v/1.6k = 3.125mA
5v/1k = 5mA
Is there any noticeable difference? I'm fine with 1.6k.
The main things that I want to achieve are as follows :

Device is reliable and robust to a certain degree. (designed to protect the users)
Device is 100% compatible with Vanilla software without patching or hacks and all basic software works as is without hacks. (designed to avoid forking of the firmware like msextra/ms-b&g has had and all the associated nightmares)
Good good, those are separate, and mandatory items to be FreeEMS complaint. Now I have a more accurate picture of the situation.

* So far, my board seems to be robust. I still have to decide how to connect the cpu board and the connector board.
* Being 100% compatible is hard, at least for now, mostly because of the pinout.
My ignition outputs are right, probably. I expect that ignition will be always in port T, as well as RPM inputs.
Injector outputs are in port B, a port that doesn't seem to be useful except for bit banging. (No SPI,I²C, ADC,etc)
Stepper and auxiliary outputs are in PORT A, which is the same thing as port B (both A and B are available for data addressing, and we don't care about it).

If you have a proposal list for the ADC connections, maybe its a good time to try to modify my board. I have freed some space in it.
Something like:
CH1 = MAP¿
CH2 = Baro
CH3 = CLT, etc etc
is that information available somewhere?

So, if a board works out of the box with a vanilla software (which is easy to check, its mostly pinout), and the community can check it is reliable, we have a FreeEMS compliant board. Cool. I thought it was harder than that.

I vote for a "freeems capable" sticker :P
Marcos
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS for Argentina

Post by Fred »

nitrousnrg wrote: 5v/1.6k = 3.125mA
5v/1k = 5mA
Is there any noticeable difference? I'm fine with 1.6k.
3.125 * 8 = 25mA = max current per port rating! That is why, and yes, 1.6k worth of resistor between outputs and other devices is part of compliance because without it you can't reasonably guantee that the CPU won't lock up (this happens if you overload the port) and hold the pins in any random unknown state potentially causing burned coils, flooded engines, worn out rings, hydrauliced rods/hgs, etc. I can't find the reference for you to prove it, but you can trust me that that is the case. The main thing is, that if a power transistor or mosfet cant be driven properly directly from the CPU through such a resistor, then with a slightly lower value resistor it will still be marginal, and therefore it should be driven through a buffer of some sort. Make good sense? Tear me apart if not.
Being 100% compatible is hard, at least for now, mostly because of the pinout.
My ignition outputs are right, probably. I expect that ignition will be always in port T, as well as RPM inputs.
Injector outputs are in port B, a port that doesn't seem to be useful except for bit banging. (No SPI,I²C, ADC,etc)
Stepper and auxiliary outputs are in PORT A, which is the same thing as port B (both A and B are available for data addressing, and we don't care about it).
There is actually a pin out document, which is slightly out of date, but pretty much right, available. In it it states that port t has inputs and fuel outputs, but that is changing to be inputs and ignition as you have it. As for port A and B, be careful! These two registers are back to back, and it makes sense to use 16bit writes across them, SO, which one you have routed for fuel WILL probably matter. The code isn't written yet, though. And the pin state during reset is not determined either, yet. Hence my warnings about not being able to make a design yet. It might be a waste of PCB. I'm not going to compromise the design just because someone already built a board. If you want your ADCs on different ports than I have them, then we need to discuss the POSSIBLE semantics of that too, and develop some code to handle it. I'm still not convinced about that, though. I also can't believe that it's that hard to route them as I have them. It is true that all the accessory ADC inputs should be configurable, but having the core ones that way seems superfluous and prone to misconnection. One of the guiding principals is to not have things configurable that don't need to be. Such as the individual firmware per decoder setup, etc.

I think you're rushing ahead! Somewhere earlier in this thread we discussed that finalisation of your board wouldn't be possible for several months, at least, and dependent on someone bench testing those reset power states, and then the forum members reaching a reasonable resolution on the pin buffers and pin outs etc.
If you have a proposal list for the ADC connections, maybe its a good time to try to modify my board. I have freed some space in it.
Something like:
CH1 = MAP¿
CH2 = Baro
CH3 = CLT, etc etc
is that information available somewhere?
YES!!! :-) RTFM ;-) That was one of the first documents I drew up as I knew it would be required by pretty much anyone doing anything with the device (users, sw devs, fw devs, hw devs).
So, if a board works out of the box with a vanilla software (which is easy to check, its mostly pinout), and the community can check it is reliable, we have a FreeEMS compliant board. Cool. I thought it was harder than that.
It is a little more complex, the grounds and powers MUST be properly seperated. I wont compromise on some basic minimum standards, I don't want MegaSquirt quality devices floating around with my firmware, and having a standard, that enough devices meet and are approved up to the standard of, will prevent that to some extent. If we make a big enough deal out of it, people won't want non compliant devices, it should be more or less that simple.
I vote for a "freeems capable" sticker :P
Great idea! :-) Perhaps "FreeEMS HW-1.0 Compliant" or something like that. Then we can roll out with 1.1 and 2.0 and have 2.0 be something entirely different, etc. Good idea, worth discussing.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
nitrousnrg
LQFP144 - On Top Of The Game
Posts: 468
Joined: Tue Jun 24, 2008 5:31 pm

Re: FreeEMS for Argentina

Post by nitrousnrg »

5v/1.6k = 3.125mA
5v/1k = 5mA
Is there any noticeable difference? I'm fine with 1.6k.
3.125 * 8 = 25mA = max current per port rating! That is why, and yes, 1.6k worth of resistor between outputs and other devices is part of compliance because without it you can't reasonably guantee that the CPU won't lock up (this happens if you overload the port) and hold the pins in any random unknown state potentially causing burned coils, flooded engines, worn out rings, hydrauliced rods/hgs, etc. I can't find the reference for you to prove it, but you can trust me that that is the case. The main thing is, that if a power transistor or mosfet cant be driven properly directly from the CPU through such a resistor, then with a slightly lower value resistor it will still be marginal, and therefore it should be driven through a buffer of some sort. Make good sense? Tear me apart if not.
No. those 25mA are the specified max current per pin, not per port. I recommend the application note AN2434 (Input/Output Pin Drivers on HCS12 Family). A brief extract of it:

"When this document was written, the MC9S12 Family did not specify maximum current for all pins combined. (Limits are implied by device thermal characteristics, which are described in the device user guide or data sheet.) Some other MCUs have both a maximum pin current specified (before VOL and VOH may go out of specification) and a maximum total device current specified (to prevent metal migration)."

I won't use 1.6k right now, only because I don't have any 1.6k 0805 resistor. Total power dissipation is something to be aware of, I think this MCU could get very hot if you push it near its limits.
YES!!! :-) RTFM ;-) That was one of the first documents I drew up as I knew it would be required by pretty much anyone doing anything with the device (users, sw devs, fw devs, hw devs).
Where? I didn't see your ADC setup in freeems-vanilla/docs, nor in the docs page. Should I get that info from the firmware?
It is a little more complex, the grounds and powers MUST be properly seperated. I wont compromise on some basic minimum standards, I don't want MegaSquirt quality devices floating around with my firmware, and having a standard, that enough devices meet and are approved up to the standard of, will prevent that to some extent. If we make a big enough deal out of it, people won't want non compliant devices, it should be more or less that simple.
Yep, thats in my little text file as part of the standard :-) I neither want crappy hw with the freeems name on it.
As for port A and B, be careful! These two registers are back to back, and it makes sense to use 16bit writes across them, SO, which one you have routed for fuel WILL probably matter. The code isn't written yet, though.
I understand that a 16bit write would make sense for someone opening the micro (addressing external devices), but where can we use a 16bit write?

I could move the stepper to port P, (PWMable), which I guess it will be the preferred port for optional devices (now I have on it a fuel pump and an aux output). I just found out it is easier to route to the stepper driver. Port A is in the opposite corner of the cpu.
I think you're rushing ahead! Somewhere earlier in this thread we discussed that finalisation of your board wouldn't be possible for several months, at least, and dependent on someone bench testing those reset power states, and then the forum members reaching a reasonable resolution on the pin buffers and pin outs etc.
Rushing ahead? How did you notice that? :P
This is going to be a test bench, not intended to be promoted. I have materials to make two boards, I expect (I hope!) the third one will be a proper freeems board. Still, I want to be as close as possible to the standard pinout from the beginning.
My challenge for this summer will be get a flashing led. That involves a correctly made pcb, a working BDM programmer, and the reflow oven working. I could test the external circuits (stepper, P&H, filters, etc) right now if I had the time.
Marcos
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: FreeEMS for Argentina

Post by jharvey »

nitrousnrg wrote:I won't use 1.6k right now, only because I don't have any 1.6k 0805 resistor.
Why so much chatter about a device that can be changed in minutes. I say put what you want it, I don't see a reason not to go the 1.6k. I belive it will drive what it needs to drive. However I think it's a mild point.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: FreeEMS for Argentina

Post by Fred »

No. those 25mA are the specified max current per pin, not per port. I recommend the application note AN2434 (Input/Output Pin Drivers on HCS12 Family).
No, this is absolutely false! The MS1 chip has 20mA per pin, specified. hcs12 chips (mostly) do not have a per pin specified, however somewhere the per port is specified and it's a lot weaker than the MS1 chip. How did I learn this? Heaps of people following bogus recommendations in the msextra manuals frying their ms2 cpus from overload. Stuff that worked sweet on ms1 failed to work or killed ms2 units. Trust me! OR... take one of your cpus, load up some code, and apply 25mA to 8 pins on a single port (A, B, P, T, whatever) and watch it fail.
I won't use 1.6k right now, only because I don't have any 1.6k 0805 resistor. Total power dissipation is something to be aware of, I think this MCU could get very hot if you push it near its limits.
Fair enough, for right now, it doesn't matter, but in terms of production units stuff like that will matter. And yes, thermal issues could be problematic too. It's OK as is, even for the non auto spec chip, just. But attention should be paid to this, yes.
Where? I didn't see your ADC setup in freeems-vanilla/docs, nor in the docs page. Should I get that info from the firmware?
On my box:

/home/fred/workspaces/home/freeems-vanilla/docs/XDP512-freeEMS-pin-assignment.ods
I understand that a 16bit write would make sense for someone opening the micro (addressing external devices), but where can we use a 16bit write?
Generic (and maximally efficient) code for firing up to 12 or even 16 sequential injectors. I'm not saying it WILL be done that way, but it quite possibly could. For example, if you uncomment the existing broken code, I believe it does work that way, as B is the low port from memory, so b0 is pin 1 and a0 is pin 9 etc.
I could move the stepper to port P, (PWMable), which I guess it will be the preferred port for optional devices (now I have on it a fuel pump and an aux output). I just found out it is easier to route to the stepper driver. Port A is in the opposite corner of the cpu.
Seriously, routing concerns MUST come secondary to functional concerns. As for port P, yes, it would definitely be what I would attach GP FET drivers for accessory use to. On the other hand, there is NO way I would put the default fuel pump relay driver on there. That should go on a random useless single pin somewhere. I don't think I chose that pin, yet, make some suggestions and I'll have a look. PWM for the fuel pump will be an optional extra feature and probably require a specific board or a mod or just rewiring the fuel pump to a non-default pin (with appropriate hard core fet driver OFF of the board, though)
Rushing ahead? How did you notice that? :P
This is going to be a test bench, not intended to be promoted. I have materials to make two boards, I expect (I hope!) the third one will be a proper freeems board. Still, I want to be as close as possible to the standard pinout from the beginning.
My challenge for this summer will be get a flashing led. That involves a correctly made pcb, a working BDM programmer, and the reflow oven working. I could test the external circuits (stepper, P&H, filters, etc) right now if I had the time.
I just don't want to see you wasting parts! Or wasting time etching boards that are useless because I move a dozen pins just after it comes out of the acid bath, etc.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply