![]() |
Because interface is in development stage, therefore some functionalities for debugging were provided to facilitate further interface development.
All functions mentioned below were included within Hardware Abstraction Layer (HAL).
Nodes of prosthesis system contain much information about their vendor, serial number, transmission channels and other relevant parameters. Some of them are used only during program operation and there is no need to keep them in memory. However, some of them have to be saved in the non-volatile memory either external or internal one. Because the microcontroller is equipped with internal EEPROM (2kB) functions for EEPROM handling were implemented. These functions are:
Although message sending in MCP2515 is retried up to 255 times, sometimes transmission errors may occur. Application working with the PDCP should be informed that error(s) happened, therefore error structure was implemented. Every error indicated by interrupt from controller increments the value of specified elements of this structure. The application can read the whole error structure by calling function:
Inside of the HAL USART handling was included which occurred a very useful tool while debugging because it enabled printing text messages in the form of strings on serial port. In conjunction with designed PCB board (which uses simple USB port and integrated circuit emulating RS232 port) and serial terminal program installed in the computer application designer is able to print both text and for example variable values on the screen. The latter is possible thanks to itoa() or sprint() function provided by stdlib library of AVRLIBc. The function is called: