Question: Q2(a) You have been asked to develop a PIC MCU assembly-level program for an embedded system using 16F877A to regulate glucose levels in the body

 Q2(a) You have been asked to develop a PIC MCU assembly-level

Q2(a) You have been asked to develop a PIC MCU assembly-level program for an embedded system using 16F877A to regulate glucose levels in the body of someone with diabetes by continuously measuring the level of glucose and dispensing doses of insulin based on those measurements. The chemical glucose sensor generates 8-bit digital signal which is read by PORTB of 16F877A. The insulin pump is controlled by a PORTD bit 0. The pump is to be controlled as follows: If the value is greater than or equal to 240 turn on the insulin pump for 5 seconds and then turn off the pump. You can use the delay subroutine below for generating the time delay av seco ; Clock frequency 8 MHz ; Actual delay 5 seconds 10000000 cycles Error-0 % Delay 5sec 9999995 cycles movlw 0x5A movwfd! movlw 0xCD movwfd2 movlw 0x16 movwfd3 Delay.0 decfsz di, f goto $+2 decfsz d2, f goto +2 decfsz d3, f goto Delay 0 5 cycles to $+1 go goto $+1 nop return (a) Construct a flowchart to demonstrate the operation of such a system? (10 marks) (b) Design an assembly language program to implement this system. (10 marks) Q2(a) You have been asked to develop a PIC MCU assembly-level program for an embedded system using 16F877A to regulate glucose levels in the body of someone with diabetes by continuously measuring the level of glucose and dispensing doses of insulin based on those measurements. The chemical glucose sensor generates 8-bit digital signal which is read by PORTB of 16F877A. The insulin pump is controlled by a PORTD bit 0. The pump is to be controlled as follows: If the value is greater than or equal to 240 turn on the insulin pump for 5 seconds and then turn off the pump. You can use the delay subroutine below for generating the time delay av seco ; Clock frequency 8 MHz ; Actual delay 5 seconds 10000000 cycles Error-0 % Delay 5sec 9999995 cycles movlw 0x5A movwfd! movlw 0xCD movwfd2 movlw 0x16 movwfd3 Delay.0 decfsz di, f goto $+2 decfsz d2, f goto +2 decfsz d3, f goto Delay 0 5 cycles to $+1 go goto $+1 nop return (a) Construct a flowchart to demonstrate the operation of such a system? (10 marks) (b) Design an assembly language program to implement this system. (10 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!