iesalais 0 Posted April 5, 2018 Share Posted April 5, 2018 Hello, I'm trying to run a code I found for a water depth sensor MS5540C and I'm coming across a compilation error: "error: 'TCCR1B' was not declared in this scope" anyone know what is going on? code can be found here http://www.fut-electronics.com/wp-content/uploads/2015/10/water_depth_sensor_MS5540C_Arduino_tutorial.pdf thank you! Quote Link to post Share on other sites
Rei Vilo 695 Posted April 5, 2018 Share Posted April 5, 2018 See points What Information to Provide When Asking for Help and Porting an Arduino library to Energia at Suggestion: Add a FAQ. TCCR1B is a register of the ATmega MCU and is not portable to the non-specified board you're compiling against. Quote Link to post Share on other sites
iesalais 0 Posted April 6, 2018 Author Share Posted April 6, 2018 sorry about that. im using the Red MSP-EXP432P401R . using the latest version of Energia on windows you think you can help me port these 2 lines of code to energia? i failed to find anything online and i already looked at the Porting an Arduino library to Energia guide. TCCR1B = (TCCR1B & 0xF8) | 1 ; //generates the MCKL signal analogWrite (clock, 128) ; i mean, there should be a way to "generate the MCLK signal" using energia right? any help would be great P.S. i have 'clock' = pin 6 on msp432 (supposed to be my MCLK pin, not sure if its the proper Pin to use) Quote Link to post Share on other sites
Rei Vilo 695 Posted April 6, 2018 Share Posted April 6, 2018 According to the data-sheet of the MS5540C, the MCLK is a 32.768 kHz square-wave signal to be provided by the MCU. I don’t whether and the MSP432 provides such signal. You will need to dig deep into the data sheet of the MSP432. Is there a particular reason for using that specific sensor? The most popular barometer sensor is the Bosch BMP280, with a large choice of libraries for Energia. According to the data-sheet of the MS5540C, this sensor is specific for swimming watches, hence the availability of the 32.768 kHz square-wave signal. Quote Link to post Share on other sites
energia 485 Posted April 9, 2018 Share Posted April 9, 2018 You should be able to do this with driverlib. You will have to source timer_a from ACLK which in it's turn can be sourced from LFXTCLK which is the 32.768 kHz crystal on the MSP432 LaunchPad. You should be able to find some examples by googling. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.