Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

BASCOM AND MD328D CHIP
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various
View previous topic :: View next topic  
Author Message
Plons

Bascom Member



Joined: 24 May 2005
Posts: 434
Location: Hilversum - The Netherlands

netherlands.gif
PostPosted: Wed Jul 06, 2016 3:09 pm    Post subject: Reply with quote

Just for test purposes, I used Google Translate for a piece of text. It came out like this:

Quote:
When switching between different clock prescaler set to switch the system clock prescaler to ensure that no hairs in the switching process


Not bad at all ! And the hairs made me LOL

Nard

_________________
Bascom AVR ver 2.0.8.1
ProtectedParallelPortProgrammingDongle: http://www.aplomb.nl/TechStuff/PPPD/PPPD%20English.html
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4925
Location: Holland

blank.gif
PostPosted: Wed Jul 06, 2016 8:02 pm    Post subject: Reply with quote

this cheap appears to be a clone and compatible. so it will work with bascom too.
_________________
Mark
Back to top
View user's profile Visit poster's website
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Thu Jul 07, 2016 5:17 am    Post subject: Reply with quote

Mark,

I noted many news things ( and different too ):

- 32Kb for Flash AND EEprom together ! This is the bad thing :

If I want to use 32Kb for program memory, there will be 0K for EEprom !
But if I use only 16Kb for program memory, I can have 8K for EEprom !

- RC clock for 32 Mhz with 1% precision !

- 32 Khz asynchronous mode !

- two pins from Analog Input can be used as DAC output !

- there are two Op Amps internal to use with analog signals ....

I will read the PDF with calm in the next weekend to see more improvements. But I'm thinking in many new possibilities with this cheap and powerful IC .

I suspect that will be not so easy to Bascom have full support for this new IC . But if you can make it, will make me very happy ! Very Happy

Paulo
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4925
Location: Holland

blank.gif
PostPosted: Thu Jul 07, 2016 8:16 am    Post subject: Reply with quote

since this chip seems to be a clone i wonder how long atmel will tolerate it. so i will not put a lot of effort in it to support it 100%.
But since you have access to the registers, that should not stop you right? you can control all the different hardware.
I am only talking about basic support.

_________________
Mark
Back to top
View user's profile Visit poster's website
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Thu Jul 28, 2016 11:33 am    Post subject: Reply with quote

yes this chip work with bascom
it is serial programing like avr dude
i translating the pdf to inglish if some are interested i will post the pdf
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Fri Jul 29, 2016 2:53 am    Post subject: Reply with quote

Benoit,

For sure I'm interested, please post the .PDF in English !

Paulo
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Tue Aug 02, 2016 4:03 am    Post subject: Reply with quote

Hi Benoit,

Today I received the Massduino board with the Md-328D processor.
At the first sight, I noted room for two conectors, but can't find in Inhaus website any info about them.

But I'm slowly reading the .PDF you have posted, in Chinese language, ( while you don't post the translated .PDF ) , and noted some interesting info :

- The ADC can convert 12 bits. Not 16 bits as noted in some docs about use in Arduino IDE. I suspect that in this case the 16 bits are made with oversampling.
- There are one option to clock at 32 Mhz with 1% calibrated RC oscilattor.
- And there is one internal op-amp that can be used in inverting mode or non-inverted mode, with gain about 11 or 12. And the ADC can read the output from this amp-op too !
- The PWM have 6 channels, but 4 channels can be clocked from a 64 Mhz internal clock !
- I see that internal registers are very compatible with normal Atmega328. There are many new options in registers, and this is because of many new hardware things implemented.
- There is one document explaining the use of Atmel Studio 4 to compile one program.

At last, I have another question :

Where we can find the FUSE configurations ?

And how these Fuses are write ? What program can be used ? What hardware ( for example USBASP ) can be used whitout make the microcontroller useless ?

Paulo
Back to top
View user's profile
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Tue Aug 02, 2016 6:23 am    Post subject: Reply with quote

HI APHAWK

the 6 pin connector is for ISP but not for programing because it is another chip than atmel avr
the 3 pin connetor is for jtag like

you can use xloader and serial at 115200 BAUD for program the code compilated with bascom hex file

i have not finish to translate the pdf . the charts must be reworked too so it take time

i have tested the 32 MHZ CLOCK and the output can reach near 7 MHZ

I have not made further test yet

it is possible to include the name and the adress register in a file.dat for use directly with bascom

off course all this will be more clear when the English doc will be ready Laughing

in fact it is the pcb that can be use with atmega328P SMD CHIP but the md328D is a new chip don t try to get it compatible or to detect it as atmega328P

That all for the moment
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Tue Aug 02, 2016 3:01 pm    Post subject: Reply with quote

Hi Benoit,

Thanks for your efforts !

I noted that the maximum ADC clock is 10 Mhz, if this is true will be a great improvement.

I'm waiting for the translated PDF to make one library with some new "special" functions to use , like the two DAC outputs, the Fast PWM, and the new analog input functions.

But I suspect that the need to change Fuses to select the oscillators mode.... then your translation will be very fine !

Paulo
Back to top
View user's profile
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Tue Aug 02, 2016 8:09 pm    Post subject: Reply with quote

HI APHAWK
I am at 10 % translated yet i will post when finish but at least 20 DAY REMAINING
when i will be at 50% i will post

keep in touch
Back to top
View user's profile
aphawk

Bascom Member



Joined: 23 Jan 2010
Posts: 152
Location: Brazil

brazil.gif
PostPosted: Wed Aug 03, 2016 9:37 pm    Post subject: Reply with quote

Benoit,

It's ok, I'm testing with Arduino IDE. Have your own time, my friend !

But I'm thinking about all new possibilities I can have using this small chip. But to use the chip at 32 Mhz clock, I need to write new Fuses...

Until now, I have tested it with four small projects with LED PWM, LCD, ADC inputs, I2C, and all works normal with Arduino IDE.

But I want to use the MD328-D alone , like I use today Atmega328 in some projects.

Even in a board similar with Arduino Uno, the price that the Inhaus sells 100 pieces of MASSDUINO LC, at US$ 1,99 each, is very low. And the product seems reliable in my tests.

And for only the micro controller MD328-D, for 100 pieces the price will be US$ 0,799 each... is a good price anyway even if only to replace the Atmega328. I don't believe that this chip is totally code-compatible , but I pretend test it.

The new functions are amazing, I have copied one small resume to others members understand my curiosity :

MD-328D 8-bit Microcontroller with 32K bytes In-System Programmable Flash

Features

More Fast Timers

Two 8bit Timer/Counter with independent prescaler
One 16bit Timer/Counter with independent prescaler
64MHz internal frequency for fast and high resolution PWM ( wow !!!! )
Up to 6 channels PWM with dead band support

More accuracy analog modules

8-channel 12bit Analog to Digital Converter (ADC) ( wow !!! )
Internal independent power monitor channel (VCC/4 ) ( very nice !!! )
Internal High resolution 1.25V/2.56V 1% voltage reference ( very nice !!! )
2x Analog comparator with 2x 8bit DAC for internal reference
2x Fixed-gain, dual direction OPA frontend for ADC/AC
2-channel 8bit DAC output ( very nice !!!! )

More other improvements

High resolution internal 16MHz 1% RC oscillator
Low power 32KHz RC oscillator
Low power POR and 3-level Low voltage detector
More efficiency active and sleep power control

Digital Peripherals

SWD Two-wire On Chip Debug & Programming Interface
Programmable Watch dog timer
Async/Sync Universal Receiver/Transmitter (USART)
Master/Slave SPI Interface
Master/Slave Two-wire Interface (TWI), compatible with I2C

More Robust Working Environment

0~20MHz @ 1.8V ~ 5.5V
-40C ~ +85C
4000V HBM ESD

More useful analog modules ( this is very very interesting !!! )

Internal voltage reference for ADC and source of DAC
8bit DAC output to one channel of Analog comparator ( very nice !!! )
Each OPA support up to 2 external input channels
OPA support x12 gain in normal mode and x11 in input-inverting mode
OPA output can be sampled by ADC
Analog comparator support flexible filter backend
Comparator output can be used to disable PWM output automatically
AC combined with OPA can be used to implement flexible over-current and over-voltage circuits

More fast timer and PWM

Internal frequency double generate 64MHz clock for fast timer application
Up to 500KHz@7bit high resolution PWM ( wow !!!! )
Dead cycle inserted to protect external MOSFET driver
PWM can be disabled automatically by analog comparator or other sources
Up to 6 channel PWM output
Up to 4 channel support fast PWM and dead cycle insertion



I don't understand the Dead Cycle insertion in PWM, but will make a search to learn about.

Paulo
Back to top
View user's profile
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Sat Aug 06, 2016 8:00 pm    Post subject: Reply with quote

HI PAULO
Here some part of translated doc
hope it wille help you to go head with this chip
next part next week Confused Smile

have fun
Back to top
View user's profile
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Sat Aug 06, 2016 8:04 pm    Post subject: Reply with quote

part of pdf translated
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Sat Aug 06, 2016 8:10 pm    Post subject: Thanks for the translation Reply with quote

Thanks for your work!!
Back to top
View user's profile Visit poster's website
benoit

Bascom Member



Joined: 24 Jul 2007
Posts: 177

france.gif
PostPosted: Sat Aug 06, 2016 8:14 pm    Post subject: Reply with quote

EXAMPLE OF PROGRAM in bascom

$regfile = "MD328Ddef.dat"
$crystal = 32000000
$hwstack = 40
$swstack = 16
$framesize = 32
Tckcsr = 0
Clkpr = 128 'SET THIS BIT FIRST TO CHANGE CLOCK SPEED
Clkpr = 1 '32 MHZ INSTEAD OF THE 8mhz by default
Rccal = &HFF
Pmcr = &B00000001
Config Portc = Output
Do
Portc = 255

Portc = 0
Loop

the program toggle the portc at hight speed around 7 MHZ

HI PAULO you can made your own .dat file including name of register and adresses

you can compile with bascom and get the hex file and send to the ship with an external program named xloader
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Various All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum