PDA

View Full Version : pic basic pro (novice user)



f6ggy
- 2nd October 2003, 16:16
in order to program a synthetizer on a station radio hamradio, it is necessary to send in series (MSB LSB) two numbers, one on 10 bits (ex 567 into binary) and the other on 7 bits (ex 4 into binary) how declarer these two variables because I will want to safeguard them in eeprom and surout to send them on porta.0 in s?rie thank you for your assistance

Melanie
- 3rd October 2003, 14:29
Well, in PBP there are only three kinds of variables, bit, byte and word. If it's more than one bit, you use a byte. If it's more than 8 bits, then you use a word. Words can easily be broken into two bytes, and then saved and/or recalled from EEPROM.

You didn't say if your sythesiser requires serial input in the form of sychronous or asynchronous data. This determines if you use something like SEROUT or something like SHIFTOUT. With SHIFTOUT you can easily preset the number of bits to whatever length you require. With SEROUT it's not easy to send data other than 7 or 8-bits at a time. How this is approached will depend on your synthesiser's actual requirements.

Melanie