Hi all,

I am trying to get some serial communication running on my Amicus18 board.
My goal is to operate a radio module and show settings on a Nokia 5110 GLCD.
(http://hamshop.cz/avr-arduino-raspbe...-dra818v-i266/)

Both need serial communication. First, for the GLCD I use the great Gabi/Bob Nokia 3310 driver and it works fine. I can change all the settings and fonts and put my own text and graphics on the screen.

Second test was talking to the radio module via the USART tx pin (RC6), using "Hserout" and that works fine too. The module accepts the commands (old modem-like commands AT+..........) and sent an acknowledgement which I can check with a serial com's monitor.
Because the GLCD uses the PIC's USART I then tested it with the use of "RSOut" on pin A.1: no problem, works fine too!

Now both the GLCD and radio module together using the default port/pins for the GLCD and pin A.1 for the radio module using the code listed below.
What I expected was that the text string was sent 10 times to the module and after that the programmed text was printed on the GLCD.

What happend was that the text on the GLCD was printed as soon as the communication to the radio module started and stayed on the screen during the 10 times the string was sent. After that the screen went blank. The radio module accepted the commands as expected.

What am I doing wrong? Compiler version is 3.5.7.1

Thanks, Wim




Code:
'****************************************************************'*  
'*  Name    : UNTITLED.BAS                                      *
'*  Author  : [select VIEW...EDITOR OPTIONS]                    *
'*  Notice  : Copyright (c) 2015 [select VIEW...EDITOR OPTIONS] *
'*          : All Rights Reserved                               *
'*  Date    : 19-1-2015                                         *
'*  Version : 1.0                                               *
'*  Notes   :                                                   *
'*          :                                                   *
'****************************************************************






 ;--------------------------------------------------------------
 ; Declares
 
 Dim n As Byte
 Declare Rsout_Pin PORTA.1                                      ; port A.1 is data out to radiomodule
 Declare Rsout_Mode 0                                           ; TX data to radiomodule is non-inverted
 
 Symbol Nokia_CLK    PORTC.3                                    ; Nokia 3310 - SCK pin
 Symbol Nokia_SDA    PORTC.5                                    ; Nokia 3310 - SDIN pin
 Symbol Nokia_DC     PORTC.6                                    ; Nokia 3310 - D/#C pin
 Symbol Nokia_CS     PORTC.7                                    ; Nokia 3310 - #SCE pin
 Symbol Nokia_RESET  PORTC.2                                    ; Nokia 3310 - #RES pin
 ;--------------------------------------------------------------
 ; Includes
 
 Include "Amicus18.inc"                                         ; Amicusbord gebruiken
 Include "3310_MEMdriver_RC3.inc"                               ; Display driver Nokia 3310/5110 gebruiken
 ;--------------------------------------------------------------
 ; I/O pinnen vaststellen
 
 Output Nokia_CLK     
 Output Nokia_SDA         
 Output Nokia_DC        
 Output Nokia_CS         
 Output Nokia_RESET 
 Display_INIT
 
 ;--------------------------------------------------------------
 
; Transmitting data to radiomodule 

main:
    For n = 1 To 10
        RSOut "AT+DMOSETGROUP=0,145.4000,145.4000,0000,1,0000", $0d, $0a                  
        DelayMS 1000
    Next n

; printing text on GLCD

    Clear_Mem                                                                         
    Cls
        SelectFont f12x12               
    Print At 10,10,"145.4000"
        SelectFont f8x8
    Print At 10,25,"CTCSS TX uit"
    Print At 10,35,"CTCSS RX uit"
        refreshMem 0
    
    End
    
 ;--------------------------------------------------------------
 ; Fonts Includes
 
 $ifdef use_Font_f8x8
    Include "f8x8.inc"
 $endif
 ;$ifdef use_Font_clock24x49
 ;   Include "Clock24x49.inc"
 ;$endif
 $ifdef use_Font_f13x16
    Include "f13x16.inc"
 $endif    
 $ifdef use_Font_f8x11
    Include "f8x11.inc"    
 $endif
 $ifdef use_Font_f12x12
    Include "f12x12.inc"
 $endif    
 ;$ifdef use_Font_f9x14     
 ;   Include "f9x14.inc"
 ;$endif
 ;$ifdef use_Font_decode6x5   
 ;   Include "decode6x5.inc"
 ;$endif    
 ;$ifdef use_Font_arrows15x18   
 ;   Include "arrows15x18.inc"
 ;$endif