Hi Theo,
Welcome here !
look at the help from Bascom about PS/2 : CONFIG ATEMU
unfortunately : The PS2 Keyboard and mouse emulator needs an additional commercial addon library.
[url]https://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=35&category_id=6&option=com_phpshop&Itemid=1[/url]
Bon courage
JP :wink:
↧
BASCOM-ARDUINO : Arduino Leonardo as a password storage device in a PS/2-line : REPLY
↧
BASCOM-ARDUINO : Arduino Leonardo as a password storage device in a PS/2-line : REPLY
Hi JP
Thanks for the reply.
When I started the project I have made a program using the Arduino IDE as I found in the web that a serial output i.e via USB is only possible with the Arduino Leomardo (Atmega32u4).
But the Leonardo can only send one letter in the used program as I noticed. Therefore I bought the Bascom-compiler to solve the problem.
Is it possible to use the buffer to read out serially a string containing 8 password letters ? Afterwards it has to be send serially via RS232 which can be converted by hardware.
Regards
Theo
↧
↧
BASCOM-ARDUINO : Arduino Leonardo as a password storage device in a PS/2-line : REPLY
I use Arduino Uno and arduino M2560, so I don't know very well leonardo, but I see in the Arduino site :
[quote:ea994f4db0]The Leonardo has a number of facilities for communicating with a computer, another Arduino, or other microcontrollers. The ATmega32U4 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). [/quote:ea994f4db0]
and I know Basic Bascom is a complete program with a lot of possibilities for serial communications. and with a long help file :wink: you must spend time to learn ! :?
see the help for "using uart" you can follow the sample about buffer data
the Ischarwaiting() instruction is very powerfull to fill an array of chr.
I use it like that :
another µP send a sentence stating by Chr(254) and stop with Chr(255)
---------------------------
Do
Sentence = "" : Kbyte = 1 : Serialflag = 0
Open "com3:" For Binary As #1
Do
If Ischarwaiting(#1) = 1 Then
Jbyte = Waitkey(#1)
If Jbyte = 254 Then
Serialflag = 1
End If
If Serialflag = 1 Then
If Jbyte = 255 Then
Clear Serialin3 ' note the Clear statement !!!
Close #1
Exit Do
End If
Tabdate(kbyte) = Jbyte 'i fill a array
Kbyte = Kbyte + 1
End If
End If
Loop
L1byte = L1byte + 1
---
---
loop
----------------
then you can fill a sentence with text = mid (........, J, 1)
Take care, in serial communication, we work in Ascii code .
take care about chr(13) chr(10)
use the ";" after print : print "bonjour"; ' print without chr(13 and chr(10)
JP
↧
BASCOM-AVR : XMEGA crystal 32 KHz is not working for RTC : REPLY
MWS,
Thanks for tinkering. I think I finally have a solution to the mystery. I believe I tricked myself by having multiple versions of the same board. At one point in testing, I swapped them without noticing.
I went back, and pulled the breakout boards out of the breadboard sockets to look at the solder jumpers on the bottoms of the breakout boards. The board that successfully generates the 32.768 KHz sinusoidal waveform on the watch crystal is the board where I moved the jumpers connecting the watch crystal to pins R0 and R1. In that chip, the fuse byte is set to use TOSC on pins R0, R1. In the other board that has the watch crystal connected to alternate TOSC pins E2, E3 the external RTC function does not work. The "bad" board appears to be healthy when using the internal RC version of the RTC oscillator, but the external RTC won't oscillate regardless of fuse bit settings.
In the data sheet, as Mark noted, it looks as if the chip does not support switching the watch crystal to the alternate TOSC pins. In the table, the alternate TOSC connection is only listed for R0/R1.
I wonder. Why would the test board have jumpers to allow connecting the watch crystal to pins E2/E3?. I am guessing the board is built that way so the one board can be used with multiple versions of the chip. Some versions of the chip can support using alternate TOSC on pins E2/E3, and some can not.
This is strange. The non-USB version datasheet also seems to list alternate TOSC only on R0/R1. I think I will bow to the inevitable, and simply use the watch crystal on R0/R1, as was suggested very early. In any case, the chip allows the necessary function, if used correctly.
Thanks again for testing.
Bill
↧
BASCOM-AVR : XMEGA crystal 32 KHz is not working for RTC : REPLY
For applications needing a small chip, I will also test an ATxmegaC4. The data sheet for the ATxmegaC4 shows that its TOSC1/TOSC2 connections can be routed to the E3/E2 pins. I will be curious to test whether the C4 can simultaneously run a 16 MHz crystal connected to pins R0/R1. BASCOM does not yet have a DAT file for the ATxmegaC4, but I suppose it should be possible to create a custom DAT file.
↧
↧
BASCOM-AVR : XMEGA crystal 32 KHz is not working for RTC : REPLY
After my "tinkering" I would have surely loved to get some feedback about the created code, hex and bas, i.e. what it did to the boards, especially the more "peculiar" ones.
If I boil down your post, then one of the boards has an working oscillator, is my assumption is right then, does this include the proper function as intended of driving Sectic with the external crystal?
Also, what effect does my code have on the non-working boards, which leads to the question: What code did you use to test?
One more advice: While it does not have to be always rewarding to answer a question in a forum, i.e. put some efforts, even small ones into the answer, proper feedback of the one seeking help assures that next time he still has somebody willing to reply to his request.
It's not a "I do my owns stuff in my own direction and you folks around may provide suggestions.", it's rather the way of reacting to and replying to suggestions, improving, repeat that all over again and finally have success.
I actually found the issue interesting and would have liked to see the solution, but frankly: it was only this interest in the issue that kept me posting.
↧
BASCOM-AVR : Should be simple but I2C EEPROM doesn't seem to be working f : NEWTOPIC
I've been having some issues using an I2C EEPROM (AT24C256B) so I decided to get back to the basics. The problem is, the following code ALWAYS returns "161" (yes, I know the significance of that) no matter what I try. I know the IC2 works with a DALLAS DS3231 because it's on the same I2C buss and I can read/write that just fine.
Real code:
[code:1:aaedcae694]$regfile = "m328def.dat"
$crystal = 16000000
$hwstack = 800
$swstack = 400
$framesize = 150
'EEPROM Addressing Constants
Const EEPROMW = 160 'EEProm 1 write (binary 1010_0000 )
Const EEPROMR = 161 'EEProm 1 read (binary 1010_0001)
Declare Sub Write_EEprom(ByVal Address As Word)
Declare Sub Read_EEprom(ByVal Address As Word)
Dim Data As Byte
Data = 22
Call Write_EEprom(1)
Call Read_EEprom(1)
Print "Data " ; Data
End
Sub Write_EEprom(Address As Word )
Local H_A As Byte
Local L_A As Byte
H_A = High(Address)
L_A = Low(Address)
I2cstart
I2cwbyte EEPROMW
I2cwbyte H_A
I2cwbyte L_A
I2cwbyte Data
I2cstop
WaitMs 10
End Sub
Sub Read_EEprom(Address As Word)
Local LocalLoop As Byte
Local H_A As Byte
Local L_A As Byte
H_A = High(Address)
L_A = Low(Address)
I2cstart
I2cwbyte EEPROMW
I2cwbyte H_A
I2cwbyte L_A
I2cstart
I2cwbyte EEPROMR
I2crbyte Data , Nack
I2cstop
End Sub
[/code:1:aaedcae694]
As I said, it ALWAYS returns 161 (which is the EEPROMR constant of course). The EEPROM address lines are all strapped to ground (A0,A1, A2). No matter what address I use as part of my calls (in my example I show a 1 but I have tried all sorts of different ones)
[b:aaedcae694][color=red:aaedcae694](BASCOM-AVR version : 2.0.7.8 )[/b:aaedcae694][/color:aaedcae694]
↧
BASCOM-AVR : Programming Adafruit Feather 32u4 Adalogger : NEWTOPIC
Hi,
Has anyone tried programming the above mentioned board with Bascom over the virtual comm port? I have not used the Aduino system but I assume the bootloader should communicate with the Bascom "Arduino" programmer. I am not completely sure what baud rate the bootloader operates at but other boards in that family use 57K6. It is probably something stupid I am doing.
The Adalogger shows up in the device tree on COM7.
Any help is muchly appreciated!
-Greg
[b:6c6e92eefc][color=red:6c6e92eefc](BASCOM-AVR version : 2.0.7.8 )[/b:6c6e92eefc][/color:6c6e92eefc]
↧
BASCOM-AVR : Should be simple but I2C EEPROM doesn't seem to be working f : REPLY
One first step would be not to use reserved words as variable names
↧
↧
BASCOM-AVR : Should be simple but I2C EEPROM doesn't seem to be working f : REPLY
have a look at the samples, there is already a sample for reading/writing eeprom chips
[quote:9f4e2aee46]
$regfile = "m88def.dat"
$lib "i2c_twi.lbx"
$crystal = 8000000
$baud = 19200
$hwstack = 40
$swstack = 40
$framesize = 40
Config Scl = Portc.5
Config Sda = Portc.4
'connect A0 and A1 to ground, A2 to VCC
Declare Sub Writebyte515(address As Word , Value As Byte)
Declare Function Readbyte515(address As Word) As Byte
Dim B As Byte , Adrs As Word
Dim Hdr As Byte , L As Byte , H As Byte , J As Byte
Dim Choice As Byte , Wstart As Word
Config Twi = 400000
I2cinit
Print "24LC515 EEPROM DEMO"
Do
Input "0-write 10, 1-read 10, 2-read block ,3 clear" , Choice
Select Case Choice
Case 0 'write 10 bytes
For Adrs = 0 To 15
B = Adrs
Writebyte515 Adrs , B 'write value
Next
Case 1 'read 10 bytes
For Adrs = 0 To 15 'read values back
B = Readbyte515(adrs)
Print B 'and show them
Next
Case 2 'read dump
Inputhex "Start $" , Wstart
Hdr = &B10100000
Hdr.3 = Wstart.15 ' A15 address bit
H = High(wstart)
L = Low(wstart)
I2cstart
I2cwbyte Hdr
I2cwbyte H
I2cwbyte L
I2crepstart 'repeated start
Hdr.0 = 1 ' we will read now
I2cwbyte Hdr
For J = 1 To 63
I2crbyte B , Ack 'read byte
Print Hex(b) ; ",";
Next
I2crbyte B , Nack 'read byte
Print Hex(b)
I2cstop
Case 3
For Adrs = 0 To 15
B = &HFF
Writebyte515 Adrs , B 'write value
Next
End Select
Loop
End
'write a byte to the 24LC515 memory
Sub Writebyte515(address As Word , Value As Byte)
Hdr = &B10100000
Hdr.3 = Address.15 ' A15 address bit
H = High(address)
L = Low(address)
I2cstart
I2cwbyte Hdr 'address with A15 segment bit
I2cwbyte H 'MSB
I2cwbyte L 'LSB
I2cwbyte Value
I2cstop
Waitms 10
End Sub
'read a byte from the 24LC515 memory
Function Readbyte515(address As Word) As Byte
Hdr = &B10100000
Hdr.3 = Address.15 ' A15 address bit
H = High(address)
L = Low(address)
I2cstart
I2cwbyte Hdr
I2cwbyte H
I2cwbyte L
I2crepstart 'repeated start
Hdr.0 = 1 ' we will read now
I2cwbyte Hdr
I2crbyte Readbyte515 , Nack 'read byte
I2cstop
End Function
[/quote:9f4e2aee46]
↧
BASCOM-AVR : Programming Adafruit Feather 32u4 Adalogger : REPLY
I do not know that board. You best update and then try arduino stk500 v2 programmer. at some stage they switched from stk500 to stk500v2 protocol.
It appears that every arduino has its own boot loader with different protocol.
The leonardo needed 2 different virtual com ports (one normal and one for the boot loader) and a change to 1200 baud for reset.
For these kind of boards it is simpler to use avrdude with the 'external programmer' from bascom.
↧
BASCOM-AVR : E-Paper EPA20-A : REPLY
By now, there are many applications for these e-Papers.
Does anyone use BASCOM to control them via SPI ?
Are examples available ?
Best regards,
Greece2001
↧
BASCOM-AVR : E-Paper EPA20-A : REPLY
Have a look at the German bascom forum.
Hkipnik have written great drivers for various displays.
I hope he can upload it to our forum too , someday.
But for now : [url]https://bascomforum.de/index.php?thread/60-e-paper-display-epa20-a-172x72-pixel/[/url]
↧
↧
BASCOM-AVR : Should be simple but I2C EEPROM doesn't seem to be working f : REPLY
Followup to this.
Mark, in fact I know the code I posted as it was working on a slightly different version of the EEPROM (24C512). As it turns out, I was not supplying VCC to the 24C256 and hence the problem. As soon as I did supply power, my posted code started working. Strange that it would return "161" however...
Thanks to you and MWS for the comments
↧
BASCOM-AVR : want to transfer eeprom via UART to PC... Problem with binar : NEWTOPIC
Hi friends,
I want to transfer eeprom from avr to pc. I tried to made it via binary format (printbin var)... That runs pretty nice, but When eeprom value is zero, the avr didnt transfer a byte to pc.
That is my problem which I have.
I want to transfer 128 byte, and when one value is zero, it is missing in data transfer. Has anybody an Idea?
[code:1:412693c4f6]
do
uart=inkey(#1)
if uart =200 then
csum=0
for temp_byte = 1 to 128
Readeeprom bblock , temp_byte
printbin #1, bblock
next temp_byte
printbin #1,csum
end if
loop
[/code:1:412693c4f6]
kind regards
Jan
[b:412693c4f6][color=red:412693c4f6](BASCOM-AVR version : 2.0.7.8 )[/b:412693c4f6][/color:412693c4f6]
↧
BASCOM-AVR : want to transfer eeprom via UART to PC... Problem with binar : REPLY
printbin will also send a zero. it is simple to check with the simulator. (when you turn option to show as hex)
you better check your PC code.
↧
BASCOM-AVR : Programming Adafruit Feather 32u4 Adalogger : REPLY
Leonardo doesn't have stk500 compatible bootloader at all.
It has an "Caterina" bootloader that's based on the LUFA CDC bootloader. The lufa bootloader speaks avr109 protocol.
Avrdude supports avr109 programmer so maybe you can try that.
↧
↧
BASCOM-AVR : Programming Adafruit Feather 32u4 Adalogger : REPLY
bascom also support the AVR910 protocol. select the myAVR MK2 / AVR910 prgorammer in that case.
↧
Share your working BASCOM-AVR code here : analog alarm clock and cooking timer (Files added) : REPLY
Hello JP
Thank you for sharing your wonderful project. I guess with such a timer and wife/cook you do not need to go to a restaurant :D
Three timers in one device is very handy. I do not recall to have seen such an alarm clock.
We have several timers, but they are all single timers.
I only can not find the circuit. Lots of nice images. icons etc. Maybe i overlook something?
↧
BASCOM-AVR : Programming Adafruit Feather 32u4 Adalogger : REPLY
AVR910 is not AVR109.
Looks the same, but the numbers are in a different order ;-)
↧