Hi, When I try to simulate the attached code in the BASCOM built-in simulator, two interrupt buttons appear correctly on the interrupt tab: OC2A and OC3A. After starting the simulation and clicking on OC2A, the variable v2 increments, but nothing happens when I click on OC3A. It works correctly with the ATmega1284p processor. Am I doing something wrong?
your mistake is that you use COM1 but PC0 and PC1 are for the second USART1. Thus use config COM2 instead. Always check the I/O multiplexing chapter 3 in the datasheet. Then check the column of the package which is the most left column Then look up the hardware resource like USARTn and 0,TXD means TX pin for the fist UART which is COM1 in BASCOM. Then also check the PIN column which is PA0 and PA1.
Here is the documentation for the VB10A sensor: https://en.surertech.cn/viewfilebizce/1982625602085134336/surertech%20Specification-VB10A-V3.0.pdf
I have my simple test board. The sensor's TxD is directly connected to PC1, and the sensor's RxD is connected to PC0. When I connected the sensor to the PC via the UART-USB adapter, I got the data as in the screenshot. The LCD display itself works very well. The libraries and description on this page are great: https://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/ColorLCD/AVRColorLCD.html
It seems that there is something wrong with my UART configuration, because even a simple print does not send data to the PC.
lcdat 1,1, " TEST VB10A ", Yellow , Black lcdat 12,1, " UART ", green , Black ENABLE INTERRUPTS A = 1 do lcdat 32,12, a, green , Black Print "znak :" ; A incr a waitms 500 loop $include "color8x8.font"[/code:1:720ccff545]
You upgraded from AVR64da64. - from what - did you had working code before - did you test the UART using the terminal emulator? do you get data? - is it your own hardware or did you use some ready board? is there a circuit - please make samples simple as possible and leave out as much hardware as possible especial LCD displays that not everybody has - ideal is to use a second UART that debugs information. with the cheap USB-COM devices it is simple to add an additional COM port.
Hi, I recently upgraded to an AVR64da64 and am trying to read data from a VB10A sensor. Unfortunately, my test program isn't reading any information. Could someone explain what I'm doing wrong?
'configure the USART Config Com1 = 460800 , Mode = Asynchroneous , Parity = None , Databits = 8 , Stopbits = 1 Open "COM1:" For Binary As #1 Config Serialin1 = Buffered , Size = 10
'dimension a variable Dim znak As Byte Dim ramka(4) As Byte Dim Idx As Byte Dim Dystans As Word Dim kontrol As Byte Dim suma_kontrol As word
$lib "glcd-ST7735S_1R8_128x160.lib" Config Graphlcd = Color , Cs1 = Porte.5 , Rst = Porte.6 , A0 = Porte.7 , Si = Portf.0 , Sclk = Portf.1 Initlcd Cls Setfont Color8x8 Const Red = &B1110_0000 Const Yellow = &B1111_1100 Const Orange = &B1110_1100 Const Green = &B0001_1100 Const White = &B1111_1111 Const Black = &B0000_0000 Const Blue = &B0000_0011 Const Magenta = &B1110_0011 waitms 10
led_lcd alias portf.5 led_lcd=0
waitms 50
lcdat 1,1, " TEST VB10A ", Yellow , Black lcdat 12,1, " UART ", green , Black idx=0 ENABLE INTERRUPTS
do If Ischarwaiting(#1) > 0 Then znak = Inkey(#1) If Idx = 0 Then If znak = &H5C Then Idx = 1 ramka(1) = znak End If Else Incr Idx ramka(idx) = znak End If
If Idx = 4 Then suma_kontrol = ramka(2) + ramka(3) kontrol = Low(suma_kontrol) kontrol = Not kontrol If kontrol = ramka(4) Then Dystans = ramka(3) Shift Dystans , Left , 8 Dystans = Dystans + Ramka(2) lcdat 32,1, hex(ramka(1)); " "; hex(ramka(2)); " ";hex(ramka(3)); " ";hex(ramka(4)); " " , orange , Black lcdat 42,1, "D= "; dystans; " mm ", red, black end if Idx = 0 end if end if waitms 5 loop $include "color8x8.font"[/code:1:e41f5594b7]
[code:1:9fba150818] ;This routine is called when the LCD must be initialized [_Init_LCD] .EQU cu_rs = 3 ; PD.3 = cu register select line .EQU cu_en = 4 ; PD.4 = cu enable line .EQU cu_en2= 2 ; PD.5 = cu enable line 2 .EQU cu_wr = 6 ; PD.6 = cu write [/code:1:9fba150818]
[b:9fba150818].EQU cu_en2= 2 must be .EQU cu_en2= 5[/b:9fba150818]
Yes that is a relief. As you might have understood i migrated the server. It was a lot of work and all was tested using a different domain name. but after migration still some things were broken. That is because i tried to update all software. For this forum and some other components that was not possible. At least not yet. Now i need to recover.
New WebSite : test : REPLY
Yes that is a relief. As you might have understood i migrated the server. It was a lot of work and all was tested using a differen...
Taster mit transparenten Kappen zum Beschriften Lange gesucht und jetzt endlich gefunden. Für Selbstbauprojekte die auch "nach etwas aussehen sollen", ist es schön, wenn man Bedienelemente hat, w...
»
Int1 Durchgriffsrecht, Hierarchieproblem. Grüß Euch
Eine kurze beschreibung des Programmablauf. Es werden 10 Phasen durchlaufen, ab Phase 5 nur mehr Zeitgesteuert.
Ich habe jetzt eine Brem...
»
DA-Wandler MCP4725 Hallo,
Den A/D-Wandler auf Platinchen hätte ich gerne verwendet.
MCP4725
Gibt es hier Unterlagen/Anleitungen/Code um ihn mit einem AVR "m2560de...
Frohe Ostern Euch allen ein frohes Osterfest
Wünsche euch weiterhin interessante Projekte mit unserem wunderbarem Hobby.
Jetzt noch eine Bitte in eigener Sache...
»
Clock with alarm A working version of the Alarm Clock program. I want to improve the program so that it can record sound to a flash drive via ADC (but I don’t know ...
Date published: Mon, 13 Apr 2026 12:22:31 +0000 Details
R.I.P Ben Zijlstra
Remembering Ben Zijlstra
We hope that people who love Ben will remember and celebrate his life.
more info at MCS
www.mcselec.com/index2.ph...
»
KaRadio webradio ESP8266
The Dimitris board is available at https://github.com/dsaltas/WiFi-WebRadio
This is a hardware project for Ka-Radio
»
93C46 small tool to edit 93C46 eeprom written in BascomAVR & VB
Bascom control the 93C46 so we sent data via comport from VB
code will be added later ...
»
nRF24L01+ RC Controller This is a RC controller TX & RX unit with nRF24L01+
nRF24L01+ / with PA and LNA for longer range
facts:
TX
1 x potmeter for servo
...
»
RAW lcd Connecting RAW lcd to atmega8
the lcd is 6 digit + time glass
LCD Hour Meter for tractor ,air compressor, ect
the lcd have 4 com pins & 14...