Hello,
can anyone post a link or copy whole Bascom code thet is mentioned at the begining of this post?
Thanks in advance
↧
BASCOM-AVR : Soft-SPI working - HW-SPI not working : REPLY
↧
BASCOM-AVR : Bascom 2080 / USBASP programmer / ATMEGA328PB : NEWTOPIC
In version 2080 an error occurs with my USBASP programmer when I start Identify Chip:
"ATmega328PB , Flash : 32768 , EPROM: 1024
Chip Device ID : 1E9516
Can not set clock frequency. Please check for usbasp firmware update"
I bought a new USBASP programmer with "V2.0" , but it is the same problem.
Has everyone else this problem and how could it be solved ??
I try to use the ATmega328PB because I need 3 timers with 16Bit.
In the attached testcode the compiler show an error when I say "enable icp1". The equivalent register order "Timsk1.5 = 1" can be compiled and works (in simulator)
The same with icp3. icp5 not tested.
"Lock and Fuse bits" in the programmer menu offers the "Full-swing Crystal".
But the 328PB datasheet says the full swing mode is no more available ?
Is it possible to use the "m328PBdef.dat" in Bascom 2078 ? There my programmers works.
Many questions. Hope someone can help me.
Bye
Joachim
[b:ebfc309220][color=red:ebfc309220](BASCOM-AVR version : 2.0.8.0 , Latest : 2.0.7.8 )[/b:ebfc309220][/color:ebfc309220]
↧
↧
BASCOM-AVR : Bascom 2080 / USBASP programmer / ATMEGA328PB : REPLY
In 2080 there is an error/warning id the chose clock can not be set. In older versions there was no such message. But not having an indication about a failure can lead to problems when programming fuse bytes.
The question : which clock do you have selected?
The programmer will work despite the message btw.
ICP1 : it appears that TICIE1 definition is missing.
Just add it to the dat file. I will ask Tomi to check it.
fuse bits : better trust the data sheet. i will have it checked. We usually use the XML file form atmel since these are created from the same software as the actual chip.
↧
BASCOM-AVR : Bascom 2080 / USBASP programmer / ATMEGA328PB : REPLY
Hello Mark,
thanks for reply.
I tried to use
KLA987: 001110 Ext.Crystal Osc.
It didn't work. Thats why I used the intern RC-Osc.
"m328PBdef.dat" in Bascom 2078 is possible?
kind regards
Joachim
↧
BASCOM-AVR : Read Cypress Flash S25FL164K : NEWTOPIC
Hello
I have connected Cypress Flash S25FL164K with ATMEGA164p via SPI. I am not able to read the flash. has anyone worked with cypress flash before?
All I am doing is sending instruction ABh and as per datasheet I should get the device ID back. I have attached the datasheet for ref. Refer pg. 60, (6.6.1- Legacy Device Identification Commands)
[code:1:20be13bc44]$regfile = "M164pdef.dat"
$crystal = 14745600 'this freq give 0.0% error for all baud rates up to 115200
$baud = 57600
$hwstack = 80 'used for GOSUB addresses {default is 32}
$swstack = 80 'default use 10 for the SW stack
$framesize = 80 'space size for Registers defining variables
Config Serialin = Buffered , Size = 8
Config Spi = Hard , Interrupt = Off , Data_order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 4 , Noss = 1
Spiinit
Dim Spi_buffer As Byte
Dim Read_data As Byte
Spi_buffer = &B10101011 ' send Instruction code ABh
Enable Interrupts
Reset Portb.4 ' Make CS/ low
Spiout Spi_buffer , 1
Spiin Read_data , 1
Waitms 1
Set Portb.4 ' Make CS/ high
Print Read_data
[/code:1:20be13bc44]
[b:20be13bc44][color=red:20be13bc44](BASCOM-AVR version : 2.0.7.5 , Latest : 2.0.7.8 )[/b:20be13bc44][/color:20be13bc44]
↧
↧
BASCOM-AVR Old versions : Read Cypress Flash S25FL164K : REPLY
hi,
maby missing
config output for Portb.4
$hwstack
$swstack
$framesize
↧
Various : Hi everyone, where to buy atxmega cheaper? : REPLY
Hi,
http://www.microchipdirect.com
Buy directly from them in most countries.
Just take a look.
I used to pay double at well known companies....
Hubert
P.S. no affiliation with Microchip, but since they bought Atmel, I post this.
↧
Various : Hi everyone, where to buy atxmega cheaper? : REPLY
After checking others, most of them seem to have lowered their prices.
Arrow Electronics seems to be a good choice with some chips.
Hubert
↧
BASCOM-AVR Old versions : Read Cypress Flash S25FL164K : REPLY
This is how i write read W25Q16dv
here is my test setup compare it to your datasheet
[code:1:cdbc6dc878]$regfile = "m328pdef.dat"
$crystal = 8000000
$baud = 38400
$hwstack = 64
$swstack = 64
$framesize = 80
'SPI config
Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 64 , Noss = 0
Spiinit
'Chip Select handling of portB.0
'If the Noss = 1, the hardware SS internal management but are not limited,
'IMPORTANT!
'The Winbond W25Q16DV 16Mbit chip (also) organized WORD,
'So the CS rate is to be treated separately, as the HW-solving and bytes
' datasheet
'https://www.digchip.com/datasheets/download_datasheet.php?id=1571180&part-number=W25P16
'25q mcu
'/CS : Chip
'DO : MISO
'DI : MOSI
'Clk : Sck
Chip Alias Portb.0
Config Portb.0 = Output
Set Chip
Declare Sub Jedec_id()
Declare Sub Device_id()
Declare Sub Parameter_page()
Declare Sub Read_data()
Declare Sub Write_data()
Declare Sub Clear_mem()
Declare Sub Clear_pp()
Declare Sub Write_dis()
Declare Sub Write_en()
Declare Sub Stbit()
Dim Sent_data(8) As Byte
Dim Sent_p(8) As Byte
Dim read_data_tmp(8) As Byte
Dim my_data(8) As Byte
Dim Data_in(4) As Byte ' the array of input data
Dim Data_out(8) As Byte ' the array of 'output data
Dim Mem_p As Byte
Dim St_bit As Bit
Dim Dummy As Byte
Dim Datas As Word
Dim Data_l As Byte At Datas Overlay
Dim Data_h As Byte At Datas + 1 Overlay
Dim Address As Long
Dim Addr_l As Byte At Address Overlay
Dim Addr_m As Byte At Address + 1 Overlay
Dim Addr_u As Byte At Address + 2 Overlay
Dim Addr_x As Byte At Address + 3 Overlay
Addr_x = 0
Enable Interrupts
Dim A As Word
Dim B As Byte
' W25Q16 (2097151 bytes) = 16 Mbit
Print "Start ."
Print "read chip id"
Call Jedec_id()
Print Hex(read_data_tmp(1)) ; Hex(read_data_tmp(2)) ; Hex(read_data_tmp(3))
Print
Print "read Manufacturer Device Id "
Call Device_id()
Print Hex(read_data_tmp(4)) ; Hex(read_data_tmp(5)) ; Hex(read_data_tmp(6))
Print
'call Clear_mem()
'(
')
'test for mem write data 256 bytes write
A = 0
Print "Write 255 bytes "
For Address = 0 To &HFF Step 2
Incr A
Data_h = Addr_m
Data_l = Addr_l
Call Write_data()
Print Hex(address) ; "h: " ; Hex(data_h) ; Hex(data_l)
Next
Print "Writeing DONE "
Wait 5
Print "data dump: "
wait 1
For Address = 0 To &H1FFF Step 2 '8191
Call Read_data()
Print Hex(address) ; "h: " ; Hex(my_data(1)) ; Hex(my_data(2))
Next
Print "Reading DONE "
End
' Manufacturing and Memory code reading
Sub Jedec_id()
Mem_p = &H9F
Reset Chip
Spiout Mem_p , 1
Spiin Read_data_tmp(1) , 3
Set Chip
'Call Stbit()
End Sub
Sub Device_id()
Mem_p = &H90
Reset Chip
Spiout Mem_p , 1
Spiin read_data_tmp(1) , 6
Set Chip
Call Stbit()
End Sub
' PARAMETER PAGE
Sub Parameter_page()
Address = 0 'Long type variable!
Sent_p(1) = &H53 'read parameter page
Sent_p(2) = &H00 'address 3 byte
Sent_p(3) = &H00 '000000
Sent_p(4) = &H00
Reset Chip
Spiout Sent_p(1) , 4
Spiin read_data_tmp(1) , 3
Set Chip
Addr_u = read_data_tmp(1)
Addr_m = read_data_tmp(2)
Addr_l = read_data_tmp(3)
Print "CHIP ID: " ; Read_data_tmp(1) ; Read_data_tmp(2) ; Read_data_tmp(3)
' address Checking
'Parameter page deleted?
If Address = &HFFFFFF Then '16777215
Address = 0
Print "Flash: empty "
Wait 2
Goto Zero
End If
'The memory is full? (Address = 1FFFFF)
If Address = &H1FFFFF Then '16777215
Print "Flash: full "
End If
Address = Address + 2
Zero:
Call Clear_pp()
Sent_data(1) = &H52 'parameter page write
Sent_data(2) = &H00 'dummy
Sent_data(3) = &H00 'dummy
Sent_data(4) = &H00 'address
Sent_data(5) = Addr_u 'data1
Sent_data(6) = Addr_m 'data2
Sent_data(7) = Addr_l 'data3
Sent_data(8) = &H00 'data4 -> empty because of a couple of bytes to be!
Call Write_en()
Reset Chip
Spiout Sent_data(1) , 8
Set Chip
Call Stbit()
Cls
End Sub
' RAM read
Sub Read_data()
my_data(1) = 0
my_data(2) = 0
Mem_p = &H03
Sent_data(1) = Mem_p
Sent_data(2) = Addr_u
Sent_data(3) = Addr_m
Sent_data(4) = Addr_l
Reset Chip
Spiout Sent_data(1) , 4
Spiin my_data(1) , 2
Set Chip
Call Stbit()
End Sub
' RAM write
Sub Write_data()
Mem_p = &H02
my_data(1) = Mem_p
my_data(2) = Addr_u
my_data(3) = Addr_m
my_data(4) = Addr_l
my_data(5) = Data_h
my_data(6) = Data_l
Call Write_en()
Reset Chip
Spiout My_data(1) , 6
Set Chip
Call Write_dis()
Call Stbit()
End Sub
' Clear RAM
Sub Clear_mem() ' clear flash ram
Call Write_en()
Mem_p = &HC7
Reset Chip
Spiout Mem_p , 1
Set Chip
Call Stbit()
End Sub
' Clear PARAMETER PAGE
Sub Clear_pp() ' clear parameter page
Call Write_en()
Mem_p = &HD5
Reset Chip
Spiout Mem_p , 1
Set Chip
Call Stbit()
End Sub
' WRITE Disable - Enable
Sub Write_dis() ' write disable
Mem_p = &H04
Reset Chip
Spiout Mem_p , 1
Set Chip
End Sub
Sub Write_en() ' write enable
Mem_p = &H06
Reset Chip
Spiout Mem_p , 1
Set Chip
End Sub
' STATUS bit
' It will only be over when the memory of the transactions are finished!
Sub Stbit()
St_bit = 0
Kezd:
Mem_p = &H05
Reset Chip
Spiout Mem_p , 1
Spiin Dummy , 1
Set Chip
St_bit = Dummy.0
If St_bit = 0 Then Exit Sub
Goto Kezd
St_bit = 0
End Sub[/code:1:cdbc6dc878]
data via comport :
[quote:cdbc6dc878][00]Start .
read chip id
EF4015
read Manufacturer Device Id
14EF14
Write 255 bytes
00000000h: 0000
00000002h: 0002
00000004h: 0004
00000006h: 0006
00000008h: 0008
0000000Ah: 000A
0000000Ch: 000C
0000000Eh: 000E
00000010h: 0010
00000012h: 0012
00000014h: 0014
00000016h: 0016
00000018h: 0018
0000001Ah: 001A
0000001Ch: 001C
0000001Eh: 001E
00000020h: 0020
00000022h: 0022
00000024h: 0024
00000026h: 0026
00000028h: 0028
0000002Ah: 002A
0000002Ch: 002C
0000002Eh: 002E
00000030h: 0030
00000032h: 0032
00000034h: 0034
00000036h: 0036
00000038h: 0038
0000003Ah: 003A
0000003Ch: 003C
0000003Eh: 003E
00000040h: 0040
00000042h: 0042
00000044h: 0044
00000046h: 0046
00000048h: 0048
0000004Ah: 004A
0000004Ch: 004C
0000004Eh: 004E
00000050h: 0050
00000052h: 0052
00000054h: 0054
00000056h: 0056
00000058h: 0058
0000005Ah: 005A
0000005Ch: 005C
0000005Eh: 005E
00000060h: 0060
00000062h: 0062
00000064h: 0064
00000066h: 0066
00000068h: 0068
0000006Ah: 006A
0000006Ch: 006C
0000006Eh: 006E
00000070h: 0070
00000072h: 0072
00000074h: 0074
00000076h: 0076
00000078h: 0078
0000007Ah: 007A
0000007Ch: 007C
0000007Eh: 007E
00000080h: 0080
00000082h: 0082
00000084h: 0084
00000086h: 0086
00000088h: 0088
0000008Ah: 008A
0000008Ch: 008C
0000008Eh: 008E
00000090h: 0090
00000092h: 0092
00000094h: 0094
00000096h: 0096
00000098h: 0098
0000009Ah: 009A
0000009Ch: 009C
0000009Eh: 009E
000000A0h: 00A0
000000A2h: 00A2
000000A4h: 00A4
000000A6h: 00A6
000000A8h: 00A8
000000AAh: 00AA
000000ACh: 00AC
000000AEh: 00AE
000000B0h: 00B0
000000B2h: 00B2
000000B4h: 00B4
000000B6h: 00B6
000000B8h: 00B8
000000BAh: 00BA
000000BCh: 00BC
000000BEh: 00BE
000000C0h: 00C0
000000C2h: 00C2
000000C4h: 00C4
000000C6h: 00C6
000000C8h: 00C8
000000CAh: 00CA
000000CCh: 00CC
000000CEh: 00CE
000000D0h: 00D0
000000D2h: 00D2
000000D4h: 00D4
000000D6h: 00D6
000000D8h: 00D8
000000DAh: 00DA
000000DCh: 00DC
000000DEh: 00DE
000000E0h: 00E0
000000E2h: 00E2
000000E4h: 00E4
000000E6h: 00E6
000000E8h: 00E8
000000EAh: 00EA
000000ECh: 00EC
000000EEh: 00EE
000000F0h: 00F0
000000F2h: 00F2
000000F4h: 00F4
000000F6h: 00F6
000000F8h: 00F8
000000FAh: 00FA
000000FCh: 00FC
000000FEh: 00FE
Writeing DONE
data dump:
00000000h: 0000
00000002h: 0000
00000004h: 0004
00000006h: 0000
00000008h: 0000
0000000Ah: 0000
0000000Ch: 0004
0000000Eh: 0008
00000010h: 0010
00000012h: 0002
00000014h: 0000
00000016h: 0000
00000018h: 0000
0000001Ah: 0000
0000001Ch: 0000
0000001Eh: 0000
00000020h: 0020
00000022h: 0020
00000024h: 0024
00000026h: 0020
00000028h: 0028
0000002Ah: 0028
0000002Ch: 0024
0000002Eh: 0022
00000030h: 0020
00000032h: 0022
00000034h: 0024
00000036h: 0020
00000038h: 0020
0000003Ah: 002A
0000003Ch: 0020
0000003Eh: 002C
00000040h: 0040
00000042h: 0042
00000044h: 0044
00000046h: 0046
00000048h: 0048
0000004Ah: 004A
0000004Ch: 004C
0000004Eh: 004E
00000050h: 0050
00000052h: 0052
00000054h: 0054
00000056h: 0056
00000058h: 0058
0000005Ah: 005A
0000005Ch: 005C
0000005Eh: 005E
00000060h: 0060
00000062h: 0062
00000064h: 0064
00000066h: 0066
00000068h: 0068
0000006Ah: 006A
0000006Ch: 006C
0000006Eh: 006E
00000070h: 0070
00000072h: 0072
00000074h: 0074
00000076h: 0076
00000078h: 0078
0000007Ah: 007A
0000007Ch: 007C
0000007Eh: 007E
00000080h: 0080
00000082h: 0082
00000084h: 0084
00000086h: 0086
00000088h: 0088
0000008Ah: 008A
0000008Ch: 008C
0000008Eh: 008E
00000090h: 0090
00000092h: 0092
00000094h: 0094
00000096h: 0096
00000098h: 0098
0000009Ah: 009A
0000009Ch: 009C
0000009Eh: 009E
000000A0h: 00A0
000000A2h: 00A2
000000A4h: 00A4
000000A6h: 00A6
000000A8h: 00A8
000000AAh: 00AA
000000ACh: 00AC
000000AEh: 00AE
000000B0h: 00B0
000000B2h: 00B2
000000B4h: 00B4
000000B6h: 00B6
000000B8h: 00B8
000000BAh: 00BA
000000BCh: 00BC
000000BEh: 00BE
000000C0h: 00C0
000000C2h: 00C2
000000C4h: 00C4
000000C6h: 00C6
000000C8h: 00C8
000000CAh: 00CA
000000CCh: 00CC
000000CEh: 00CE
000000D0h: 00D0
000000D2h: 00D2
000000D4h: 00D4
000000D6h: 00D6
000000D8h: 00D8
000000DAh: 00DA
000000DCh: 00DC
000000DEh: 00DE
000000E0h: 00E0
000000E2h: 00E2
000000E4h: 00E4
000000E6h: 00E6
000000E8h: 00E8
000000EAh: 00EA
000000ECh: 00EC
000000EEh: 00EE
000000F0h: 00F0
000000F2h: 00F2
000000F4h: 00F4
000000F6h: 00F6
000000F8h: 00F8
000000FAh: 00FA
000000FCh: 00FC
000000FEh: 00FE
[/quote:cdbc6dc878]
↧
↧
Share your working BASCOM-AVR code here : All-in-one game board "Gamebuino" : REPLY
Additional Information
You can start the user's program written to the micro SD card without using ISP programmer or USB cable.
Write the HEX file of the program to the micro SD card, the boot loader loads it and executes it.
Preparation
1. Prepare a micro SD card. Capacity is 2GB or less, formatted with FAT16 (aka FAT).
2. Copy the "LOADER.HEX" file (disk loader) to the SD card.
"LOADER.HEX" can be downloaded from the SD card containing the included game or from "Gamebuino-Games-Compilation".
https://github.com/Rodot/Gamebuino-Games-Compilation/archive/master.zip
The file name must be in all capital letters including the extension (.HEX).
3. Compile the program with BASCOM and create a HEX file.
4. Copy the program's HEX file to the SD card.
The file name must be within 8 letters (XXXXXXXX.HEX) and must be in all capital letters including the extension (.HEX).
Start-up
1. Insert the SD card into which the program was written into Gamebuino.
2. Hold down the [C] button and turn on the power, wait for at least 2 seconds, then release the [C] button.
3. Wait about 10 to 20 seconds, depending on the number of files in the SD card with the screen disappearing.
4. A program selection menu like the picture below is displayed.
File names with up to 8 characters are displayed.
You can also make icons yourself. (INF encoder)
5. Select the program with the [Up / Down / Left / Right] button and press the [A] button.
6. Since the confirmation screen for reading appears, press the [A] button again.
You can also display program operation instructions etc. on this screen. (INF encoder)
7. The HEX file is loaded to the AVR flash and the selected program is activated.
[url=http://www.ne.jp/asahi/o-family/extdisk/Gamebuino/GamebuinoG.jpg][img:ddcfc82358]http://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/Gamebuino/GamebuinoGs.jpg[/img:ddcfc82358][/url]
↧
AVR : BASCOM to Avrisp mkII - how?? : REPLY
sorry it is in french but it easy to translate with a E.translator
JP
↧
AVR : BASCOM to Avrisp mkII - how?? : REPLY
I forgot that :
[url]http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13603&start=0&postdays=0&postorder=asc&highlight=windows[/url]
:oops:
↧
BASCOM Project Blog : Weatherstation : REPLY
There is new Bascom-AVR and ESP8266 code for Weatherstation 4.0
All initiative from Arduino Mega 2560
Current weather but also a week forecast
Several locations
Several week forecasts
http://weerstation.benshobbycorner.nl
It is in Dutch, but with Google Translate you can translate it to your own languages. Noticed however that the pictures could not be found.
So for the pictures you have to check the original site.
Have fun
Ben Zijlstra
↧
↧
Share your working BASCOM-AVR code here : SSD1306 OLED I2C LCD 0,91inch 128x32 : REPLY
Dear Mrshilov,
All libraries that you've written, are excellent.
How can I use this library for 128x64 I2C OLED display?
↧
BASCOM-AVR : Configuring ports in Xmegas : NEWTOPIC
The Xmega ports appear to be a bit more complex than the earlier type AVRs.
I want to set the [internal] pullup and pulldown resistors for several port pins [I am setting the DDRP.n register to inout -0]
I have searched the BASCOM help file, as well as reading through the appropriate DAT file [in this case, I am using the Xmega128A4U].
I read through the sections of the datasheet that pertains to ports, but I couldn't find anything telling me how to set port functions.
I also searched this forum for information on setting up a port, but I get everything but what I need - not sure what the search function "sees?".
Can anyone point me to something that will show me how to take full advantage of these ports? I would be most appreciative!
[b:ba3cd5e152][color=red:ba3cd5e152](BASCOM-AVR version : 2.0.7.8 )[/b:ba3cd5e152][/color:ba3cd5e152]
↧
BASCOM-AVR : Configuring ports in Xmegas : REPLY
Did you look for config XPIN in the help?
↧
Share your working BASCOM-AVR code here : SSD1306 OLED I2C LCD 0,91inch 128x32 : REPLY
Look for post #33:
http://bascomforum.de/index.php?thread/120-ssd1306-oled-display-1-3-i2c-spi/&pageNo=2
↧
↧
BASCOM-AVR : XMega USB Support : REPLY
I have a project that could use an XMEGA128A4U but it would need CDC functionality on the USB port. Is there any indication of when this might be available? Thanks
↧
BASCOM Project Blog : Weatherstation : REPLY
Hello Ben,
Thanks for this great update. You documented it well. Indeed google translate will do a good job.
I need to study your v4 code. But as usual you write clear documented code, and your web shows a good explanation.
I like the new forecast screens. I also understand the eventcaster now.
Now all we need is good weather :D
↧
Share your working BASCOM-AVR code here : SSD1306 OLED I2C LCD 0,91inch 128x32 : REPLY
[quote:c10d3b17b3="Meister"]Look for post #33:
http://bascomforum.de/index.php?thread/120-ssd1306-oled-display-1-3-i2c-spi/&pageNo=2[/quote:c10d3b17b3]
Thanks a lot
↧