Main Menu
Counter
This page today ...
total: 0
unique: 0

This page ever ...
total: 215
unique: 146

Site ...
total: 3682
unique: 2014
Online
  • Guests: 1
  • Members: 0
  • Newest Member: ole
  • Most ever online: 47
    Guests: 47, Members: 0 on Wednesday 21 February 2018 - 23:52:15
Chatbox
You must be logged in to post comments on this site - please either log in from the Login box or from here.If you are not registered click here to signup.


bullet Kim
1 year ago
test
Royalsystems blog

MCS Electronics Forum

  • BASCOM-AVR : ATTINY1604 serial port : NEWTOPIC



    This is my first try at ATTINY1604 serial communication.
    I'm testing out the hardware and software serial communications by sending 4 bytes at 38400 baud.
    (one gets remarked out while testing the other)

    Problem 1:
    Printbin sends proper message, except at 600 baud (regardless off baud in Config Com1)

    Problem 2:
    Serout doesn't do anything (pin starts low, stays low)


    Is there something simple I'm overlooking.


    Thanks much!


    [code:1:23f7964c2c]$regfile = "atxtiny1604.dat" ' ATTINY1604
    Config Sysclock = 16_20mhz , Prescale = 2 : $crystal = 10000000 ' 10 Mhz
    Config Submode = New

    $baud = 38400
    Config Com1 = 38400 , Parity = None , Stopbits = 1 , Databits = 8 , Baud_offset = None , Txpin = Alt1_pa1 ' RS485 port
    Config Print = Porta.3 , Mode = Set ' RS485 TX enable
    ' Config Serialin = Buffered , Size = 4 ' RS485 port Rx buffer
    ' Config Serialout = Buffered , Size = 4 ' RS485 port Tx buffer
    ' $timeout = 1000000 ' serial port timeout

    $hwstack = 40 ' hardware stack size
    $swstack = 40 ' software stack size
    $framesize = 100 ' frame size

    'Port A
    Config Porta = &B00111010
    Tx0 Alias Porta.1
    Rx0 Alias Pina.2
    Tx0_enable Alias Porta.3 : Reset Tx0_enable

    Dim Rx0_buffer(4) As Byte
    Dim Tx0_buffer(4) As Byte

    ' test message
    Tx0_buffer(1) = &HFF
    Tx0_buffer(2) = &H00
    Tx0_buffer(3) = &HFF
    Tx0_buffer(4) = &H00

    Enable Interrupts

    Main_loop:

    Printbin Tx0_buffer(1) , 4 ' transmit message (hardware)

    ' Set Tx0_enable
    ' Disable Interrupts
    ' Serout Tx0_buffer(1) , 4 , Porta , 1 , 38400 , 0 , 8 , 1 ' transmit message (software)
    ' Enable Interrupts
    ' Reset Tx0_enable

    Wait 1

    Goto Main_loop

    [/code:1:23f7964c2c]

    [b:23f7964c2c][color=red:23f7964c2c](BASCOM-AVR version : 2.0.8.4 )[/b:23f7964c2c][/color:23f7964c2c]

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    I'm sending you an email

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    i dont get what you mean. please show the CONFIG statement and where it writes the wrong setting.
    maybe you refer to the second sample? please note that i did not specify sync option there. if you do, you will see that bit 4 will be set.

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    Hi
    you don't make the sync setting when you select the clock.
    It doesn't matter anyway. A bug in the HW won't allow synchronization anyway and you have to bypass it, see the procedure I sent.
    You write 0x05 and you would have 0x15. Ultimately you set the clock to 0x00 as a baseline and wait for the reboot to be performed.
    RS

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    [quote:c5835937a1]In your case you need to write 21dec to CTRLA and not 5dec.[/quote:c5835937a1]
    The option in config "SYNCUPDATE" only sets this bit 4 in CTRLA. it need to be used with other settings.
    It is not clear to me if you mean there is a wrong setting?

    anyway, there are always some bugs in the silicon. as long we know about it, there is no problem.

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    Hi Mark
    Yes, it doesn't make sense. It's a bug in the processor architecture.
    CCMP and CNT Registers Operate as 16-Bit Registers in 8-Bit PWM Mode
    When the TCB operates in 8-bit PWM mode (CNTMODE in TCBn.CTRLB is ‘0x7’), the low and high bytes for
    the CNT and CCMP registers operate as 16-bit registers for read and write. They cannot be read or written
    independently.

    Another thing is that if you want to use the TCA clock you have to set the sync bit of the TCB. In your case you need to write 21dec to CTRLA and not 5dec. And restart TCA, but there is another HW bug to watch out for.
    The TCA Restart Command Does Not Force a Restart of TCB
    The TCA restart command does not force restarting the TCB when TCB is running in SYNCUPD mode. TCB is
    restarted only after a TCA OVF

    These bugs are in the kernel of both AVR0 and AVR1. With AVR2 they have already fixed the sync bug, but the 8bit register access bug remains.

    RS

  • BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY



    The license is worth 83.4 Euro ok I am going to raise money. cheesey :wink:

  • BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY



    Hola :shock:

    What you write is very confusing. You also seem to mix up things.
    I doubt you get a serious reply/help this way.
    - what do you want to accomplish
    - what exact is the problem
    - where is the code
    - what does not work
    - what did you tried

    I bought my first time attiny 3216 and FTDI (CH340G) and I cannot load a simple program as a test.


    [code:1:0d1706ef89]$Regfile="atxtiny3216.dat"
    $Crystal=20000000
    $hwstack=40
    $swstack=16
    $framesize=32
    [/code:1:0d1706ef89]

    Sorry I read a mistake ..... You have to pay license first. :mrgreen: :mrgreen: ](*,) ](*,) :smt098

    [code:1:0d1706ef89]Error : 500 Line : 22 XTINY LICENSE Required , in File : C:UsersBienvenidoDesktopTiny32161.bas
    [/code:1:0d1706ef89]

    :lol: :oops:

  • BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY



    yes that is odd in these processors. i dont see the point of having separate registers if you can not update them separately.
    but i might have missed something in the data sheets. During the last year(s) i have read many of them and some have changed a few times.
    the registers are derived from the microchip atdf files.

  • BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY



    What you write is very confusing. You also seem to mix up things.
    I doubt you get a serious reply/help this way.
    - what do you want to accomplish
    - what exact is the problem
    - where is the code
    - what does not work
    - what did you tried
    - what do you think readers of the forum understand from this post? best to re-read before you post and imagine and ask your wife/husband or friend if they understand it
    Also point 1, what do you mean? is it essential? do we really care if you want or not want to update? you can also use MS-DOS of course.
    2: so you mean 'it' worked at some stage? and what was that? which micro? and what did you change in the mean time?
    3: this seems unrelated. 4 years ago there were no 3216.
    4; i dont understand what you write
    But you have to understand one thing : this is NOT THE ARDUINO forum. it is ok to use that hardware but i have no idea which processors all these boards use. And i do not care too. If you use a board, be specific about the processor. that is the only thing that matters to bascom.
    5: normally pictures are ok to explain things but in this case posting some pictures is not good.

    normally if i have to ask all these questions i ignore such posts. if a poster does not take the time to inform us why would i waste my time?
    but i understand language barrier can be a problem. So this is not only to you but anyone that posts.
    What i dont get is that you are a long time user and posted many times but somehow you still dont get it. that is discouraging.
    I hope some user can help you or understand what your problem is about.

| Date published: not known
Back to newsfeed list
Welcome
Username or Email:

Password:




[ ]
[ ]
Headlines

»BASCOM-AVR : ATTINY1604 serial port : NEWTOPIC
This is my first try at ATTINY1604 serial communication. I'm testing out the hardware and software serial communications by sendi...
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
I'm sending you an email
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
i dont get what you mean. please show the CONFIG statement and where it writes the wrong setting. maybe you refer to the second s...
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
Hi you don't make the sync setting when you select the clock. It doesn't matter anyway. A bug in the HW won't allow synchroniza...
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
[quote:c5835937a1]In your case you need to write 21dec to CTRLA and not 5dec.[/quote:c5835937a1] The option in config "SYNCUPDATE...
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
Hi Mark Yes, it doesn't make sense. It's a bug in the processor architecture. CCMP and CNT Registers Operate as 16-Bit Registers...
»BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY
The license is worth 83.4 Euro ok I am going to raise money. :D :wink:
»BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY
Hola :shock: What you write is very confusing. You also seem to mix up things. I doubt you get a serious reply/help this way....
»BASCOM-AVR : ATTINY1604 TCA0 & TCB0 : REPLY
yes that is odd in these processors. i dont see the point of having separate registers if you can not update them separately. but...
»BASCOM-AVR : Programmer MCS Bootloader_Minipro/xtiny3216 : REPLY
What you write is very confusing. You also seem to mix up things. I doubt you get a serious reply/help this way. - what do you w...


Date published: not known
Details

»Bascom Neuinstallation unter WIN 10
Hallo Zusammen, kurz vor Weihnachten hat mein Laptop, den ich zum Programmieren in Bascom verwende, seine Tätigkeit eingestellt. Ich habe mir daher...
»Ausdruck eines Listings
Wenn das Programm fertig ist und ausgedruckt werden soll klicke ich das Ikon "Ausdrucken" an. Sofort nach dem Klick wird das Schriftbild neu format...
»Mehrfachverwendung von Timern inkl. getrennter ISR
Hallo zusammen ich habe eine Frage: ist es möglich einen Timer mehrfach zu verwenden; z.B. in einem Programmteil als Timer und in einem anderen Pro...
»Fuse-Bits_Quarze+Co.
Hallo Forum, zum Start zu diesem Thema möchte ich noch einiges erklären. Dieses Thema ist sozusagen ein Abzweig und hat den Ursprung aus: Forum>>Pr...
»UART Kommunikation
Hallo zusammen! Ich bin auf der Suche nach einer eleganten Lösung um Befehle und Parameter über den UART zu empfangen. Ich möchte das Problem mögl...
»SIM800L
Für die kleinen Module SIM800L vom freundlichen Chinesen habe ich ein kleines Testprogramm das eine SMS " Hallo Welt" an ein bestimmten Empfänger ...


Date published: Fri, 23 Jul 2021 12:32:12 +0000
Details

»93c46 editor programmer bascom & vb93c46 editor programmer bascom & vb
»93c46 Bascom & VB693c46 Bascom & VB6
»Analog clock on SSD1289 3.2" 240x320 lcdAnalog clock on SSD1289 3.2" 240x320 lcd
»Nextion HMI lcd with KaraDio the best webradio esp8266Nextion HMI lcd with KaraDio the best webradio esp8266
»Adding 240x320 lcd to the WifiWebRadioAdding 240x320 lcd to the WifiWebRadio
»IV-17 Nixie clock GPS set time & date at power onIV-17 Nixie clock GPS set time & date at power on


Date published: not known
Details

»Bascom Can Bus Sniffer
»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...


Date published: not known
Details


Proudly powered by e107 which is released under the terms of the GNU GPL License.