logs archiveBotHelp.net / Freenode / #43oh / 2015 / July / 19 / 1
majuk
http://pastebin.com/NCsV10SK - slave
* Copyright (c) 2012, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Or I can do that. lol
Rickta59
do?
majuk
http://pastebin.com/WC1CcfFq - master
Rickta59
you got kicked i think
majuk
Yea, I fat-fingered ctrl-c on the master's pastebin and tried to paste the whole code into the chat.
Rickta59
so why does yours look different than the ti one
majuk
Slave code is 100% unaltered on a separate board
Rickta59
what is the file name of the master?
majuk
Blah. KiwiIRC doesn't like me.
Rickta59
are you looiing at i2c_06.c?
is that the master code
majuk
Yes
Rickta59
so using the interrupt to trigger the button is fraught with danger
the pin is going to bounce
and you aren't doing any debounce
majuk
Ah, ok, true
Rickta59
are you just trying to understand the port interrupts?
i guess what is your real goal here?
majuk
Yes, and controlling I2C
I need control of the I2C signaling. I want to be able to send 1 byte on command.
Rickta59
you might use the port interrupt to just exit
exit LPM0
and of course clear the interrupt
and disable the port interrupt
then in the main line after you wake up ..
do a ... i don't know 10msec delay
and check the pin again
if it is still down then do the send
majuk
mmk. I'll give that a spin.
Rickta59
then reenable the interrupt
and go back to sleep
or ...
you could just reset the chip after sending one byte
and then get back into the main line loop
as far as what you have
i wouldn't bother messing with the tx count in the isr
just put it in the main line
majuk
I feel like I might be able to implement your first suggestion, I'll pursue that
Rickta59
not sure what you are doing while(TXByteCtr)
what happens when it goes to zero?
P1IE |= BIT3; // P1.4 interrupt enabled
comments and code don't match
the button is P1.3
as is your code
are you using the TI compiler or gcc majuk ?
majuk
IAR Workbanch
Rickta59
ah .. ok .. nm then
majuk
I assume it is using the TI compiler
Rickta59
no they have their own compiler
majuk
Ah ok
Rickta59
why are you using that?
* just wondering
majuk
My only course using this controller we used it.
So habit.
And lack of motivation to figure out another tool.
Rickta59
k
so you have something that is licensed?
majuk
Yes
Rickta59
http://forum.43oh.com/topic/3270-low-power-mode/?p=28566 that is some interesting code that works with gcc
what other mcus are you using majuk ?
majuk
I got what I want. Finally.
http://pastebin.com/279SWR6b
That sends one byte on button push
I also fixed those comments because bad commenting is bad and I should feel bad.
;)
Rickta59
i'm glad i made you feel bad about it
you are forgiven
majuk
lol
Amperture
Man now I feel like an idiot
I was sitting here mulling over why my LM35_TO_FARENHEIT macro was fu*king up so bad since I was trying to increase precision
And here I forget that if you're multiplying the input by 100, then you should probably also multiply the entire equation by 100 (That is, the +32 to convert from C to F should become +3200)
Rickta59
oops
« prev