www.gt4dc.co.uk http://www.gt4dc.co.uk/forum/ |
|
Canbus / Power distribution systems http://www.gt4dc.co.uk/forum/viewtopic.php?f=13&t=6277 |
Page 4 of 6 |
Author: | Nibbles [ Wed Feb 20, 2013 4:37 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
My first finger in air guess was 16 bytes per output for switching based on up to 8 dig. inputs with fairly simple switching logic (and,or,not) reduced down for analogue value and > or <. Not thought that hard about storage format. So 128 bytes per module x 16 modules = 2K bytes. I'm guessing a typical road car application will probably be about 7 or 8 modules so I would want to allow for 16. I like the idea of SD card for allowing config without plugging a laptop into the system, but it will use 4 i/o which would mean no address setting via links or dipswitches. I also wouldn't like to be cartain an SD card wouldn't be zapped by a module failure so it would require a full set of SD cards to be carried along with a single PDM. The design isn't done & dusted yet, I'm leaving it to last after the digi dash stuff. |
Author: | two_OH_five [ Wed Feb 20, 2013 5:01 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
How about making the output connections via a 2 position jumper Position 1 - pdm control Position 2 - hardwired 12v It would provide ultimate get home capability |
Author: | Nibbles [ Wed Feb 20, 2013 6:24 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
A 20A jumper link ? Seems you need a special tool to get the box open costing over 100 sheets which makes it a non-starter anyway. Next thought for the day. Would you expect to switch these things off with the ignition, if so we need a relay capable of a hundred or 2 amps (I have one in mind but not checked specs yet). Alternatively, we need a power down option to slow / stop the canbus and allow the processors to go to sleep. |
Author: | two_OH_five [ Wed Feb 20, 2013 7:11 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
I was thinking more along the lines on 'nana plugs/sockets Never thought about power down. I guess the elegant way is to put everything to sleep - CAN supports suspend and resume via the bus if the dspic implementation handles a wakeup from the bus I'd guess something like a high priority go to sleep command gets issued from whicheverdm is hooked to the ignition switch The other perhaps easier system would be to run a high power cable and a low power switched cable to run the electronics. In fact I would certainly lay the boards out to accommodate that with a jumper connection to power the processors off the high current supply |
Author: | Nibbles [ Thu Feb 21, 2013 12:57 am ] |
Post subject: | Re: Canbus / Power distribution systems |
I had thought of that and was planning on making one of the 12V pins just for the logic (pins rated @ 10A so will probably run 5 or so in paralell) |
Author: | two_OH_five [ Thu Feb 21, 2013 2:20 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
Better still perhaps If you planned it so that the low power bus controlled a relay in the units you'd have the capacity to drive a virtually unlimited number - must say I struggle to see a box sucking 2A though Possibly if you implement the provision for a diode wired "or" from say output 1 back to the relay too That would give max flexibility I think If you get bus induced sleep figured out leave the relay /diode out Otherwise fit relays and either a switch powers the whole network or a single pdm can do so It's a bit of a git when you think about it in a complete system context The obvious thing would be to have the ACC position on the ignition switch power up the network. Sounds simple but you can't get in to the car to do that as the central locking is switched off What the bimmer does is, i suspect, fire it up off the door and remote sensors. I know for sure that when you take the key out and lock it the car stays awake for 20 minutes. There's various references in the BMW diagnostic software to leaving the car for >20 minutes so the car goes to sleep and takes the new setting ..... Ahh, bless,poor thing is tired after all that programming probably In this context it would be handy if every module could power up the network In fact, thinking about it in those terms you can't switch the units off by turning off the power unless you designate that some key units stay awake but in low power state |
Author: | Nibbles [ Thu Feb 21, 2013 2:54 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
I can easily 'wake' all items on the bus by driving it to a 'dominant' state from any unit for a second, so Ideally put the 'unlock' and 'ignition' on the same box and let it keep an eye on those inputs. With the pic, it's easy to get it to sleep for 1/2 sec then wake for a few milliseconds to check inputs, requires very little power (we get over a year from a coin cell on some of our stuff). Current draw for the logic is only a few milliamps so switch direct with the ignition switch. |
Author: | two_OH_five [ Thu Feb 21, 2013 3:06 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
AH-HAAAAAAAAAAAAAAAAAAHHHHHHHHHHHH Sorry, went a bit Alan Partridge there Looking at the dspic30F4013 data sheet Input Pins Datasheet wrote: 7.3 Input Change Notification Module The input change notification module provides the dsPIC30F devices the ability to generate interrupt requests to the processor, in response to a Change-Of- State (COS) on selected input pins. This module is capable of detecting input Change-Of-States, even in Sleep mode, when the clocks are disabled. There are up to 10 external signals (CN0 through CN9, CN17 and CN18) that may be selected (enabled) for generating an interrupt request on a Change-Of-State. On CAN Datasheet wrote: 17.3.2 DISABLE MODE In Disable mode, the module does not transmit or receive. The module has the ability to set the WAKIF bit due to bus activity, however, any pending interrupts remain and the error counters retain their value. If the REQOP<2:0> bits (CiCTRL<10:8>) = 001, the module enters the Module Disable mode. If the module is active, the module waits for 11 recessive bits on the CAN bus, detects that condition as an Idle bus, and then accepts the module disable command. When the OPMODE<2:0> bits (CiCTRL<7:5>) = 001, that indicates whether the module successfully went into Module Disable mode. The I/O pins revert to normal I/O function when the module is in the Module Disable mode If I read that right the can bus reverts to a simple input pin Datasheet wrote: 20.7.1 SLEEP MODE In Sleep mode, the clock to the CPU and peripherals is shut down. If an on-chip oscillator is being used, it is shut down. The Fail-Safe Clock Monitor is not functional during Sleep since there is no clock to monitor. However, the LPRC clock remains active if WDT is operational during Sleep. The brown-out protection circuit and the Low-Voltage Detect (LVD) circuit, if enabled, remains functional during Sleep. The processor wakes up from Sleep if at least one of the following conditions has occurred: • any interrupt that is individually enabled and meets the required priority level From that I infer that an input change can wake the device from low power clocks off sleep. It would also appear the CAN interface can do the same I think that means that you configure selected inputs to wake the module (via the PC configuration program) - door switches etc - and a module can then wake the rest of the system up via the CAN bus. Job jobbed |
Author: | Nibbles [ Thu Feb 21, 2013 3:27 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
Correct. Provided I've got the can on an input that has interrupt on change facility, we don't need a 1/2 sec dominant state, it will wake on the first normal transmission. Worst case is set the watchdog timer to wake it every 1/2 sec, check the input then go back to sleep. |
Author: | two_OH_five [ Thu Feb 21, 2013 4:38 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
The chip specific docs don't tell you squat It mentions that the CAN has IDLE and sleep modes but makes no mention of what they are or what they can do Assuming it's ECAN then pp66 Sect 21.12 of THIS suggests that ECAN can wake from either sleep or idle via the aptly named WAKIE setting. I've checked the specific chip doc and that setting is present so I believe a wakeup interrupt can be routed to the CAN interrupt which, if enabled, should wake the processor |
Author: | two_OH_five [ Thu Feb 21, 2013 4:42 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
To be safe do you have an INT pin that could be freed up? |
Author: | Nibbles [ Thu Feb 21, 2013 6:30 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
I/O is somewhat short on the ground with all the power pins. No int needed, if needed I can switch can off to allow the pin to be read as an I/O pin. Hopefully it can do interrupt on change, if not I can poll it every 1/2 second in between sleeps, or I can switch to low speed internal osc. which only draws microamps and poll in a software loop which wakes early if needed. |
Author: | Nibbles [ Mon Feb 25, 2013 5:50 pm ] |
Post subject: | Re: Canbus / Power distribution systems |
So to recap a typical system as an example (thanks for starting this Steve) PDM 1 - Rear of car IN 1 - Boot Open IN 2 - Fuel Level (analog) IN 3 - Fuel Warn (digital) OUT 1 - Tail OUT 2 - Brake OUT 3 - Reverse OUT 4 - Fog OUT 5 - N/S Flash OUT 6 - O/S Flash OUT 7 - Rear heater. OUT 8 - Rear wiper. PDM 2 - Door NS IN 1 - Window Up IN 2 - Window Down IN 3 - Lock IN 4 - Unlock OUT 1 - Window Up OUT 2 - Window Down OUT 3 - Lock OUT 4 - Unlock OUT 5 - Mirror Left OUT 6 - Mirror Right OUT 7 - Mirror Up OUT 8 - Mirror Down PDM 3 - Door OS1 IN 1 - OS Window Up IN 2 - OS Window Down IN 3 - NS Window Up IN 4 - NS Window Down IN 5 - Lock / unlock. OUT 1 - Window Up OUT 2 - Window Down OUT 3 - Lock OUT 4 - Unlock OUT 5 - Mirror Left OUT 6 - Mirror Right OUT 7 - Mirror Up OUT 8 - Mirror Down PDM 4 - Door OS2 IN 1 - Mirror Up IN 2 - Mirror Down IN 3 - Mirror Left IN 4 - Mirror Right IN 5 - Mirror Select PDM 5 - Dashboard 1 IN 1 - Turn Left IN 2 - Turn Right IN 3 - Hazzard IN 4 - Side IN 5 - Head IN 6 - Main / flash IN 7 - Fog In 8 - Rear Fog OUT 1 - Dash lights. OUT 2 - Main Beam warning. OUT 3 - Left Flasher warning OUT 4 - Right Flasher warning OUT 5 - Fog light warning. OUT 6 - Low fuel warning. OUT 7 - Cabin lights. PDM 6 - Dashboard 2 In 1 - Wash IN 2 - Wipe rear IN 3 - Defrost IN 4 - Brake IN 5 - Door open LHS IN 6 - Door open RHS PDM7 - Front Of Car (can be combined with 6 if wanting to mount in cabin) Out 1 - N/S Flash Out 2 - O/S Flash Out 3 - Side out 4 - Head Out 5 - Main Out 6 - Fog lights. Out 7 - Horn Out 8 - Wash IN 8 - Reverse |
Author: | Nibbles [ Sat Mar 02, 2013 12:03 am ] |
Post subject: | Re: Canbus / Power distribution systems |
Following a very underwhelming response on the kitcar forum, I think it's time to shelve this. I really can't see a market. |
Author: | Sirius [ Sat Mar 02, 2013 12:58 am ] |
Post subject: | Re: Canbus / Power distribution systems |
Was that on lowcostbuilders? |
Page 4 of 6 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |