how the data is sent? Did you tried to attach your radio directly to a PC? Maybe he just send you ASCII string or HEX value?
in fact it could make sense... let's assume it send you 4 Bytes...
30,000.000
how the data is sent? Did you tried to attach your radio directly to a PC? Maybe he just send you ASCII string or HEX value?
in fact it could make sense... let's assume it send you 4 Bytes...
30,000.000
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes, the device is setup to talk to a PC.
The PC queries the device for its set frequency, and the device returns the 4 bytes.
I know I should push the 4 bytes into 2 seperate 16 bit words.
Then I need to figure out what the decimal part is for:
Millions
Thousands
Hundreds
This seem pretty straight forward for a 1 byte word, but no so easy for me to get my head around doing it for 2 bytes, due to the carry effect.
if you have a LCD, you can do a simple test
What's happen using that?Code:HSERIN [ByteA, ByteB, ByteC, ByteD] LCDOUT $FE,1, HEX2 ByteA, HEX2 ByteB, HEX2 ByteC, HEX2 ByteD
Any model or link to your radio?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I think I got it !!!
I created a program using VB which simulates the PICSs math processing.
I realized that.
1. Even though there are 32 bits sent all together, only 26 of them are used.
Since the devices highest achievable number is 30,000,000.
2. The 5 highest bits with their corresponding multipliers directly effect the 1,000,000s place.
3. The 16 highest bits with their corresponding multipliers directly efffect the 1,000s place.
4. 18 of the bits directly effect the 100s place
So what I do is create 3 bytes.
Symbol MHZ = B5 (8 bit word)
Symbol KHZ = W3 (16 bit word)
Symbol Hz = W4 (16 bit word)
Then I go down through the 26 bits 3 times.
The first run down looks at each bit and applies that bits MHZ multiplier adding these values to MHZ
The second run looks at each bit and applies that bits KHZ multiplier adding these values to KHZ
Any time KHZ goes > 999, I do the appropriate carry to MHZ
The third run looks at each bit and applies that bits HZ multiplier adding these to the HZ value
Any time HZ goes > 999, I do the appropriate carry up through KHZ and MHZ.
Now all I have to do is transfere this code into PBC.
I hope to get that done tonight.
** this is where a simulator program comes in real handy!! **
My next step on this project is to slice some specific frequency windows into numbered slices so that the pic can control a second device based on a reading falling within a specific slice.
I love this stuff!!!!
Bookmarks