• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Software controlled radio project with PIC

Status
Not open for further replies.

camerart

Active Member
Hi,
I would like to make a SCR with a DRA818U radio module. See attached PDF.
I want to control it with a PIC, I have 16F648A PICs which may work.
I will need a program to control it, any ideas welcome.
It should be able to send and receive voice or data, so should be interesting.
I WILL ADD AND CHANGE FILES HERE, AS THEY DEVELOP.
EDIT: Here are translations from http://599.cz/view.php?cisloclanku=2015052801 website by Jarda ok1hdu.
As the ATMEGA48 isn't fully supported, I am hoping to use an 18F2431PIC instead (both 28 pin) It looks as though I will need to make an adaptor, as it looks as though they can't be used pin for pin. I am trying to convert EricG's 18F4520 program onto it. So far I've changed the LCD connections to suit.
Apart from the above complete radio, one of my interests is sending and receiving data. I think the DRA818 can be programmed by a terminal (e,g, Putty) and simply send or receive data to or from a base receiver, for e,g, balloon tracking etc. I'm going to try this first
Camerart.
 

Attachments

Last edited:

camerart

Active Member
Hi,
Looking at the examples in the DRA818U data sheet, e,g:
Volume Command
Description: This command is used to adjust the volume of module.
Format:
AT+DMOSETVOLUME=x <CR><LF>
Module response: + DMOSETVOLUME: X<CR><LF>
x in command: Volume range (1~8).
x in response: 0> succeeded; 1>failed.
Am I correct that the instruction: AT+DMOSETVOLUME=x <CR><LF> would be sent from the 16F648A to DRA818U via the UART serial port?

An example program from 599.cz added to post No1 for ideas.
C.
 
Last edited:

camerart

Active Member
Hi,
Made a start on the program (see #1). Any assistance in writing a section of code using the data sheet would be welcomed. I'll test it and add it into the latest program, this would help a lot. All I'm after to start with is the simplest of configurations, so anything is good.
C
 

ericgibbs

Well-Known Member
Most Helpful Member
hi C,
A simple working Sim example.


Define CONFIG1L = 0x00
Define CONFIG1H = 0x02
Define CONFIG2L = 0x1e
Define CONFIG2H = 0x00
Define CONFIG3L = 0x00
Define CONFIG3H = 0x83
Define CONFIG4L = 0x80
Define CONFIG4H = 0x00
Define CONFIG5L = 0x0f
Define CONFIG5H = 0xc0
Define CONFIG6L = 0x0f
Define CONFIG6H = 0xe0
Define CONFIG7L = 0x0f
Define CONFIG7H = 0x40

Define SIMULATION_WAITMS_VALUE = 1
AllDigital

'18F4520 Aug -2016

Define LCD_LINES = 4
Define LCD_CHARS = 20
Define LCD_BITS = 4
Define LCD_DREG = PORTD
Define LCD_DBIT = 4

Define LCD_EREG = PORTB
Define LCD_EBIT = 3
Define LCD_RSREG = PORTB
Define LCD_RSBIT = 2
Define LCD_RWREG = PORTB
Define LCD_RWBIT = 1
Define LCD_READ_BUSY_FLAG = 1

Define STRING_MAX_LENGTH = 46
Dim setgroupstr As String
'''''' * 46 'String to send completed data through RS232 to the DRA818V

Disable High
Disable Low

T1CON = %00000000
T2CON = 0
T3CON = 0
OSCCON = %01111100 '20MHz

INTCON = %01010000 'INT0 PB.0
INTCON2 = %10000000
INTCON3 = %00000000
PIR1 = 0
PIR2 = 0
PIE1 = 0
PIE2 = 0

IPR1 = 0
IPR2 = 0

RCON.IPEN = 1
TRISA = 0x0f
TRISB = %00010001
TRISC = %00000000
TRISD = %00001111
LATD = %00001111
TRISE.2 = 0
PORTB = 0
LATB = 0

ADCON0 = 0x01 'porta digital
ADCON1 = 0x0e
ADCON2 = %10100100

Lcdinit
Hseropen 9600

setgroupstr = "AT+DMOSETGROUP=0," 'Initial value of the string

Hserout setgroupstr 'Sending string to DRA818V
Lcdout setgroupstr 'Show values on a display

idle_loop:
Goto idle_loop
End
 

Attachments

camerart

Active Member
Hi Eric,
Well done, it compiles ok.
I'll test it with the module next.
The actual pic from the Czech website it an 18PIN ATMEGA48, so I'll try to change the program to a 182431 PIC and see if I can get the pinouts to connect.
EDIT: The designer of the Czech project, has replied, and is very cooperative, let's hope he joins in here.
Thanks, C.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi C,
Have you checked that your interconnecting logic levels meet the requirement of the PC, PIC and 818.??
E
 

camerart

Active Member
hi C,
Have you checked that your interconnecting logic levels meet the requirement of the PC, PIC and 818.??
E
Hi Eric,
What I'm testing first is the radio module, so no PIC yet.
The 818 data sheet suggests TTL, which I read covers 3.3 and 5V. I am using a FTDI usb serial adaptor, and started at 3.3V then tried 5V no affect. Also I get the error response which may show that I am using the correct settings?
From the little I've read, it's possible that the error is something wrong with the sending sentences, even though I simply copied an pasted the suggested handshake sentence.
C.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi,
OK,
On this message,
AT+DMOCONNECT <CR><LF>

I guess you didn't type <CR><LF> as part of the message.????

I would type AT+DMOCONNECT press the Enter key, then send it, so it see's AT+DMOCONNECT crlf

E
 

camerart

Active Member
Hi E,
As digits are typed into the terminal, they get immediately sent, so no 'enter' key.
Here's 'a' being typed, then copy and pasted each line in turn, showing the immediate +DMOERROR.
C.
a+DMOERROR
AT+DMOCONNECT +DMOERROR
AT+DMOCONNECT CRLF +DMOERROR
AT+DMOCONNECT CR LF+DMOERROR
AT+DMOCONNECT <CR><LF> +DMOERROR

EDIT: I'm wondering if it could be something to do with cutting and pasting and formatting etc.
 
Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
hi C,
Its important that the end of message CRLF is sent.
Which program are you using to talk to the 818.?
E
 

JimB

Super Moderator
Most Helpful Member
Just an odd thought, for CR LF are you typing the letters C R L F on the keyboard?

What the radio chip is expecting is <CR> and <LF> ie the ASCII characters for <Carriage Return> and <Line Feed>

To produce these using a terminal emulator program you need to type:

<Ctrl> M for <CR>
and
<Ctrl> J for <LF>

JimB
 

camerart

Active Member
hi C,
Its important that the end of message CRLF is sent.
Which program are you using to talk to the 818.?
E
Hi Both,
You can see the 3x variety of CRLF I 'pasted' in post#13.
I use Teraterm.
I'll try the ascii alternatives.
C.
 

camerart

Active Member
Hi,
I've tried 'every' combination of inputs, and run out of ideas. I also tried Putty, where I found a CRLF tickbox instead of adding them, no n good. I've got some more modules on their way, so we can see if they are the same.
C.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi C,
Looking thru the 818 datasheet I do not see a +DMOERROR message listed, which is puzzling.?
E

I hate to repeat this offer in view of what happened last time I posted back to you, the hardware I had tested/debugged for you.
IMHO opinion it was stolen while in transit, trying to claim thru the Post office was a pointless paper chase, designed to make claimants give up.!!

Anyway the offer is on the Table, you have my address.
 
  • Like
Reactions: jjw

ericgibbs

Well-Known Member
Most Helpful Member
hi C,
Found this on line.

Extract:

I am currently working an a proof of concept Allstar node using this Dorji
Module. I just got the module on the air as Allstar node 29061. I used a
modified FOB and the DRA818U module. The module works well and has nice
audio and running 500mw.

I did have issues programming the device. Any commands sent were responded
by an error command. I found an Arduino Library that I thought I would
try to help determine the root cause and see how someone else programmed
the module. It also gave the same results and I was afraid that the module
may be bad. I added a CONNECT command to the library to see how that would
respond. After adding the "AT+DMOCONNECT\r\n" command prior to other
commands, it work as it should, not it's not clear why.

I am currently using the Arduino Mino Pro 3.3V to set the module settings
and it's seems to be working just fine. I plan to use the Arduino as a
simple interface to program and setup the module. Ultimately, I would like
to use the BBB UART modules, but the current kernel does not support the
cape manager and the addiontal UART modules are not part of the overlays.

Here is a pointer to my project notes and an image of the current project:



I still need to complete the 3.3V power supply and complete the
documentation.
 

camerart

Active Member
Hi Eric,
Ah, someone else with the same error, that's a good find. He is using Arduino, I've tried Teraterm and putty terminals, and I think they all probably interpret what's typed, into their own language, which may have many combinations till we find it, which isn't ideal.

The idea of using a terminal to program the DRA818, was for programming a minimum light weight set-up for e,g, GPS sending etc. I think it's better to go back to plan A, with a variation. If we get the 18F2431 PIC programmed to accept inputs from a Terminal (Press button), as I have done in the past, also to be able to work as the full radio project later on, this would be a better course. In the first instance then, a simple program inputting terminal data and outputting using HSEROUT to the 818 would be good.

Thanks for the offer of debugging, I'll perhaps take you up on it later on, if all else fails.
C.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top