I've been working on the protocol and list of functions for the controlBoard... I'm trying to establish a command structure and serial protocol for the raspi-boards-raspi communications...
So far, for the control board....I have the following..
Messages will come from the micro to the raspi whenever they're either requested or a condition occurs that merits it.
Commands are sent from the raspi to the micro, they may request a message, or contain arguments that elaborate on the command.
An example might be:
0xFE 0xF0 0xC0 0xC1 0x01 0xFE 0xFF
Which would be [command_laser] [laser_power] [01] or turn the laser on..
The controlBoard should respond with:
0xFE 0xF0 0xF1 0xFE 0xFF
Which would be and acknowledgement..
I don't have this to a science yet, and this is really my first attempt at doing this so formally.. I'm not sure if I'm going to keep the start, end and flags on there or not.. I usually throw something together that works and leave it at that.. but I would like to make this easy for everyone to understand and replicate..
#define msg_cuvette_tray 0x10 #define msg_cuvette_temp 0x11 #define msg_cuvette_status 0x12 #define msg_cuvette_tray_pos 0x13 #define msg_cuvette_pelt_status 0x14 #define msg_cuvette_stepper 0x15 #define msg_filter_wheel 0x20 #define msg_filter_pos 0x21 #define msg_laser_temp 0x30 #define msg_laser_power_status 0x31 #define msg_laser_ttl_status 0x32 #define msg_laser_good_status 0x33 #define msg_laser_color 0x34 #define msg_uv_index 0x35 #define msg_ccd_pelt_status 0x40 #define msg_shutter_servo_pos 0x50 #define msg_shutter_status 0x51 #define msg_board_ID 0x60 #define msg_board_serial 0x61 #define msg_board_status 0x62 #define msg_board_time 0x63 #define msg_board_model 0x64 #define msg_board_version 0x65 #define req_reboot 0x66 #define msg_ambient_temp 0x70 #define req_baro 0x71 #define req_humidity 0x72 #define cmd_cuvette 0xA0 #define tray_open 0xA1 #define tray_close 0xA2 #define cuvette_peltier 0xA3 #define req_cuvette_status 0xA4 #define req_cuvette_temp 0xA5 #define req_cuvette_pelt_status 0xA6 #define req_cuvette_tray_pos 0xA7 #define cmd_filter_wheel 0xB0 #define filter_select 0xB1 #define filter_reset 0xB2 #define req_filter_ID 0xB3 #define req_filter_status 0xB4 #define req_filter_count 0xB5 #define req_filter_pos 0xB6 #define cmd_laser 0xC0 #define laser_power 0xC1 #define laser_ttl 0xC2 #define req_laser_good_status 0xC3 #define req_laser_color 0xC4 #define req_laser_temp 0xC5 #define req_uv_index 0xC6 #define cmd_ccd_peltier 0xD3 #define ccd_pelt_power 0xD4 #define cmd_shutter_servo 0xE0 #define shutter_open 0xE1 #define shutter_close 0xE2 #define shutter_deflect 0xE3 #define shutter_alternate 0xE4 #define req_shutter_state 0xE5 #define req_shutter_status 0xE6 #define packet_start 0xF0 #define packet_ack 0xF1 #define packet_flag 0xFE #define packet_end 0xFF
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.