PaxInstruments / t400-electronics

Electronics for the Pax Instruments T400 temperature datalogger
20 stars 9 forks source link

Button interrupt review #114

Closed charlespax closed 9 years ago

charlespax commented 9 years ago

Some of the buttons may need to be connected to interrupt pins to ensure the device can operate in logging and not logging states. We should do a review to confirm buttons are connected to interrupt pins where necessary.

In Rev 0.9 PCB, button connection assignment as below: SW_A (Logging start/stop) ---- PIN21 (TXD/INT3) PD3 interrupt INT3 SW_B (Logging deltaT) ---- PIN20 (RXD/INT2) PD2 interrupt INT2 SW_C (C,F,K) ---- PIN32 (ICP3/CLK0/OC4A) PC7 SW_D (Toggle channel) ---- PIN40 (ADC1) PF1 SW_E (Backlight ON/OFF) ---- PIN41 (ADC0) PF0

Review in t400-firmware https://github.com/PaxInstruments/t400-firmware/issues/109

For previous discussion see https://github.com/PaxInstruments/t400-electronics/issues/60

charlespax commented 9 years ago

@cibomahto can you confirm that all the buttons are connected in a way the Firmware will function while logging and while sleeping?

charlespax commented 9 years ago

Here is the full pinmap for Electronics version 0.10 as it stands right now.

Arduino ATmega32U4 T400 Interrupt Function
D0 20 SW_B INT2 Logging interval
D1 21 SW_A INT3 Logging start/stop
D2 19 SDA INT1
D3 18 SCL INT0
D4, A6 25 LCD_A0
D5 31 BATT_STAT
D6, A7 27 LCD_BL
D7 1 RTC_INT INT6 Wake for readings
D8, A8 28 LCD_CS PCINT4
D9, A9 29 VBAT_SENSE PCINT5
D10, A10 30 VBAT_EN PCINT6
D11, A11 12 FLASH_CS PCINT7
D12 26 LCD_RST
D13 32 SW_C Temperature units
D14 11 MISO PCINT3
D15 9 SCK PCINT1
D16 10 MOSI PCINT2
D17 8 SD_CS PCINT0
A0, D18 36 DATA2
A1, D19 37 DATA1
A2, D20 38 SW_D Toggle channels
A3, D21 39 SW_E Backlight
A4, D22 40 SW_PWR Power
A5, D23 41 PWR_ONOFF

Here are only the parts relevant to interrupts.

Arduino ATmega32U4 T400 Interrupt Function
D0 20 SW_B INT2 Logging interval
D1 21 SW_A INT3 Logging start/stop
D7 1 RTC_INT INT6 Wake for readings
D8, A8 28 LCD_CS PCINT4
D9, A9 29 VBAT_SENSE PCINT5
D10, A10 30 VBAT_EN PCINT6
D11, A11 12 FLASH_CS PCINT7
D13 32 SW_C Temperature units
D17 8 SD_CS PCINT0
A2, D20 38 SW_D Toggle channels
A3, D21 39 SW_E Backlight
A4, D22 40 SW_PWR Power

So we have the items below that must have or would benefit from being attached to an interrupt. The interrupts available for swapping with the pins above are PCINT4 on LCD_CS, PCINT5 on VBAT_SENSE, PCINT6 on VBAT_EN, PCINT7 on FLASH_CS, and PCINT0 on SD_CS.

Item Function Interrupt Note
RTC_INT Wake for readings INT6 Requires interrupt
SW_A Logging start/stop INT3 Requires interrupt
SW_B Logging interval INT2 Probably does not need interrupt
SW_C Temperature units none Should probably have interrupt
SW_D Toggle channels none Should probably have interrupt
SW_E Backlight none Should probably have interrupt
SW_PWR Power none Should probably have interrupt

I think we're good for Electronics version 0.10. In the next version we should try to get the remaining buttons on interrupts. However, I am not an expert here and couldn't tell you the difference between an interrupt and an pin change interrupt. @cibomahto from a firmware perspective, is there anything that should be addressed or are we good to go on ordering Electronics version 0.10 boards?

charlespax commented 9 years ago

@samchoy88 let's order it. Closing issue.

charlespax commented 9 years ago

Issue for attaching all buttons to interrupt pins for the next version: https://github.com/PaxInstruments/t400-electronics/issues/143