DM49C04 4bit UART TTL Serial Port Digital Module Test

Started by JackB, Apr 04, 2025, 11:19 PM

Previous topic - Next topic

JackB

Hello everyone,

here's some code to share for the DM49C04

these are very cheap price as 04/2025 at aliexpress  (aroud 2.50US for 3 module)

and are useful to display in my case an 8 bit binary to decimal

with only 3 connections 5Vcc,GND, Rx

The characters I use are mainly 0~9 A b C d E F for hex and some others on a 3461AS

4 digits 0.36-inch red display.

' DM49C04 4bit UART TTL Serial Port Digital Module
' Note  : Disable OSCTUNE for other PIC
' File  : "D:\Positron Code\12F683\DM49C04\DM49C04 4bit UART TTL Serial Port Digital Module.bas"
' Note  : DM49C04 Test
' Chip  : 12F683
' Date  : Apr-3-2025

Device = 12F683
Declare Xtal = 8 ; 4,8Mhz
Config  INTOSCIO, WDT_OFF, PWRTE_OFF, MCLRE_OFF, CP_OFF, CPD_OFF, BOD_ON, IESO_ON, FCMEN_ON

ANSEL = 0
CMCON0 = 7
TRISIO = %00001000
OSCCON = $70

Dim N9600 As Word
N9600 = 84                    ' 9600 8,1,N non inverted

SerOut GPIO.1,N9600,["####"]       '  Clear Display buffer

DelayMS 2000                                 ' Delay min:100   
SerOut GPIO.1,N9600,["#SSSS"]      ' Sending Data

DelayMS 2000                 
SerOut GPIO.1,N9600,["#1234"]

DelayMS 2000                   
SerOut GPIO.1,N9600,["#5678"]

DelayMS 2000                   
SerOut GPIO.1,N9600,["#90Ab"]