Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:57 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Can anyone convert this to MMBasic?

     Page 2 of 2    
Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:59am 17 Jul 2022
Copy link to clipboard 
Print this post

  pwillard said  Considering that the source code *should* have looked like this:


; FI1216 control, ADC and LED bar driver
; V0.0 141130 Initial draft
; V0.1 141201 Done ADC, LED bar
; V0.2 141202 Subroutines, TMR0
; V0.3 141203 Tetra 4s, MAX HOLD function
; V0.4 141204 Fixed AD, lose controls, enter buttons
; V0.5 141206 I2C
; V0.6 141207 Fixed I2C
; V0.7 141228 BRT Button
; V0.8 141231 THR Button
; V0.9 150118 Cal levels FI1216, f(LO)
; V0.10 150119 THR setting
; V0.11 150119 EEPROM R/W
; V1.0 150119 Release LIST P

#include <p16f818.inc>
__CONFIG _WDT_OFF & _PWRTE_OFF & _INTRC_IO & _MCLR_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_ENABLE_OFF & _DEBUG_OFF & _CCP1_RB2 & _CP_OFF
; Equates
RESET_V EQU 0x00 ; Address of RESET Vector  

OSC_FREQ EQU D'8000000' ; Internal Oscillator Frequency is 8 MHz  

; Registers
FLAGS EQU 0x20 ; Various flags
THRLVL EQU 0x21 ; Threshold level set via UI  
MAXH EQU 0x22 ; LEVEL MAX HOLD value to be shown on LED bar  
TEMPBAR EQU 0x23 ; Pattern on LED bar if it's blanked (BRT)  
TEMPTHR EQU 0x24 ; Used in threshold set routine  
BRITE EQU 0x25 ; LED Brightness  
T4S EQU 0x26 ; Tetra 4s timing  
I2CDELAY EQU 0x27 ; Used for I2C timing  
I2CBUF EQU 0x28 ; Used for I2C data  
I2CCNT EQU 0x29 ; Used for I2C bitbanger  
DB2 EQU 0x30 ; Stealth byte for prescaler (0x50-0x5F)  
TEMPW EQU 0x40 ; Context saving for interrupts  
TEMPSTATUS EQU 0x41 ; in all banks  

; Defines
#define LEDS PORTB ; 8 LED bar RB0-3 GRN, RB4,5 ORG RB6,7 RED
#define RSSI PORTA


Means to me that even if you *HAD* all the source... it would be a task to make it usable again.  Was it intentionally mangled like that?


Yes I have the full source code
but as there is no way to set the gain in the tuner I'll fine tune the settings for the display and threshold settings once I've got to the testing stage as it will simply be a matter of monitoring the voltage on pin 4 of the AD8307 and setting it then
  Devaz said  
  pwillard said  Considering that the source code *should* have looked like this:

Means to me that even if you *HAD* all the source... it would be a task to make it usable again.  Was it intentionally mangled like that?


It's easy to write some new code for it. The difficulty is the hardware and the low signal being received.

Grtz

I do have the full source, I didn't start planning this until I did.
I don't want to add amplification, I need the signals to be low level as I'm only monitoring the transmit signals from mobiles/portable radios and not the actual base station repeaters.

This way with the signal being so low the display will only be triggered when the radios are close by
the actual range and the threshold settings will be set by the touchscreen once it's been calibrated and having a good drive past several known signal sources so the threshold can be set for city (only accept higher voltage levels wich means it's close by) or country driving accept any trigger signal/voltage

If it turns out the signals are so low they can't even be picked up within a few feet then I will add a 380Mhz preamp between the antenna and unit to amplify the signal but hopefully it won't need it.
 
Devaz
Newbie

Joined: 13/07/2022
Location: Netherlands
Posts: 7
Posted: 05:07pm 25 Jul 2022
Copy link to clipboard 
Print this post

  lew247 said  
  pwillard said  Considering that the source code *should* have looked like this:


; FI1216 control, ADC and LED bar driver
; V0.0 141130 Initial draft
; V0.1 141201 Done ADC, LED bar
; V0.2 141202 Subroutines, TMR0
; V0.3 141203 Tetra 4s, MAX HOLD function
; V0.4 141204 Fixed AD, lose controls, enter buttons
; V0.5 141206 I2C
; V0.6 141207 Fixed I2C
; V0.7 141228 BRT Button
; V0.8 141231 THR Button
; V0.9 150118 Cal levels FI1216, f(LO)
; V0.10 150119 THR setting
; V0.11 150119 EEPROM R/W
; V1.0 150119 Release LIST P

#include <p16f818.inc>
__CONFIG _WDT_OFF & _PWRTE_OFF & _INTRC_IO & _MCLR_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_ENABLE_OFF & _DEBUG_OFF & _CCP1_RB2 & _CP_OFF
; Equates
RESET_V EQU 0x00 ; Address of RESET Vector  

OSC_FREQ EQU D'8000000' ; Internal Oscillator Frequency is 8 MHz  

; Registers
FLAGS EQU 0x20 ; Various flags
THRLVL EQU 0x21 ; Threshold level set via UI  
MAXH EQU 0x22 ; LEVEL MAX HOLD value to be shown on LED bar  
TEMPBAR EQU 0x23 ; Pattern on LED bar if it's blanked (BRT)  
TEMPTHR EQU 0x24 ; Used in threshold set routine  
BRITE EQU 0x25 ; LED Brightness  
T4S EQU 0x26 ; Tetra 4s timing  
I2CDELAY EQU 0x27 ; Used for I2C timing  
I2CBUF EQU 0x28 ; Used for I2C data  
I2CCNT EQU 0x29 ; Used for I2C bitbanger  
DB2 EQU 0x30 ; Stealth byte for prescaler (0x50-0x5F)  
TEMPW EQU 0x40 ; Context saving for interrupts  
TEMPSTATUS EQU 0x41 ; in all banks  

; Defines
#define LEDS PORTB ; 8 LED bar RB0-3 GRN, RB4,5 ORG RB6,7 RED
#define RSSI PORTA


Means to me that even if you *HAD* all the source... it would be a task to make it usable again.  Was it intentionally mangled like that?


Yes I have the full source code
but as there is no way to set the gain in the tuner I'll fine tune the settings for the display and threshold settings once I've got to the testing stage as it will simply be a matter of monitoring the voltage on pin 4 of the AD8307 and setting it then
  Devaz said  
  pwillard said  Considering that the source code *should* have looked like this:

Means to me that even if you *HAD* all the source... it would be a task to make it usable again.  Was it intentionally mangled like that?


It's easy to write some new code for it. The difficulty is the hardware and the low signal being received.

Grtz

I do have the full source, I didn't start planning this until I did.
I don't want to add amplification, I need the signals to be low level as I'm only monitoring the transmit signals from mobiles/portable radios and not the actual base station repeaters.

This way with the signal being so low the display will only be triggered when the radios are close by
the actual range and the threshold settings will be set by the touchscreen once it's been calibrated and having a good drive past several known signal sources so the threshold can be set for city (only accept higher voltage levels wich means it's close by) or country driving accept any trigger signal/voltage

If it turns out the signals are so low they can't even be picked up within a few feet then I will add a 380Mhz preamp between the antenna and unit to amplify the signal but hopefully it won't need it.


Yes okay, I'm currently testing with an ESP32 which I run in dual core. When I pulg a display, the output voltage of the AD8307 goes up through the field of the display, so I deleted it. It also works well for me after the filter is adjusted correctly. Extra capacitor on P4 of the AD8307 works wonders :-)
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025