Hello together electronics. I need the help of a programmer's time in micro Basic or Pic Basic else in C. I hope you can help me. I've programiert only as users of finished programs in Pics. I have the full version of Micro Basic Plus.Ich have designed a circuit with a pic 18f4520 on which hangs a 4x3 keypad to Port C, Port B hangs a 2x16 LCD display and to port D are bistable relays are switched.
The goal is an attenuator of 0-140 dB in 1 dB steps to build. The bistable relay switch on a control board in db 1,2,4,8, 10,20,40,80 db and then finally bit 9 dB at 100. The hardware does not see a problem and I've also opportunities to interrogate a number with the keypad getky and put it on the screen is. But now to my actual problem.
I need the following routine. or program
3 numbers on the keypad will be entered and confirmed with a return key (#). Alo first number read and remember, read and add 2 number 3 number and then import settings. These 3 numbers are stored in another variable, should be converted to ASCII and output on the display as a string plus additional text. I would also like the contents of the variable to use (values ​​range between 0 and 150) to pick up from a table a matching 9-bit binary value and give them to bits 0-7 in port B and a bit of port A from. So then the relay will be switched to a binäcode. Pressing the * key will be deleted and all the numbers will start over. Similarly, by the * key at any time, the routines are interrupted. Since I am a complete beginner in micro Basic I have my difficulties. It would be very kind to me when one is here to help.
Yours sincerely Christian Petersen