Hello,
I'm working in a project using MSP430G2231 as a target. I have to use a 128 bits variable but i don't now how i have to define it.
Can anyone help please !
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
I'm working in a project using MSP430G2231 as a target. I have to use a 128 bits variable but i don't now how i have to define it.
Can anyone help please !
I don't think there is a 128 bit datatype available in the msp430 compilers out there. The maximum I'm aware of is the long long datatype which is 64 bit wide in the latest code generation tools v4.
So you probably have to do implement it for yourself using the datatypes readily available.
But maybe it would be best to tell us WHY you have to use it, and what the GOAL of using it is - maybe there is a simpler solution than writing your own functions for doing I don't know what (128 bit sounds like it could be used for AES) with 128 bit.
Well the communications modules use a 8 bit (in most cases) register, so you would have to split up your 128 bits in chunks of 8 bits anyways if you want to transmit it.
So maybe it's easiest if you use an array of 8 bit elements with 16 members.
uint8_t frameArray[16];
Then you can fill your frame in 8 bit pieces and to send it you just can iterate through the array, if you are using some dynamic generated data with 16 bits then it might be easier to use a uint16_t array and cast it to an 8 bit array for transmission.
**Attention** This is a public forum