Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

mega168PA vs 168PB

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Mon Jul 18, 2016 10:06 pm    Post subject: mega168PA vs 168PB Reply with quote

Hello!

Migrating from mega8 to mega168pb I encoutered some strange behavior.
After a power-on reset MCU is not able to init the HTRC110 hitag IC properly - the read range is zerro. If I do a HW reset, MCU resets and now, HTRC110 IC isbeing configured right - read range is now 4 to 6 cm, as expected.

I use m168pdef.dat Is that ok for a 168PB MCU ? I took a look at both datasheets, and I'am not sure, what is the differece between them.


Code:

'**********************************
$regfile = "m168pdef.dat"
$crystal = 11059200
$baud = 9600
$hwstack = 100
$swstack = 100
$framesize = 100

Thanks!
BR
Andrej
Config Hitag = 64 , Type = Htrc110 , Dout = Pind.2 , Din = Pind.3 , Clock = Pind.4 , Int = @int0
 




(BASCOM-AVR version : 2079 , Latest : 2.0.7.8 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Mon Jul 18, 2016 10:35 pm    Post subject: Reply with quote

attached the PB dat file. but other than some new regs for some new hardware, i see no problem.
but that said : notice the VCC and GND pad changes between m168P and PB for the new hardware!

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

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Tue Jul 19, 2016 6:36 am    Post subject: Reply with quote

Hi Marc!

Thanks for Your ultra-quick respons. Yesterday I started to compare existing p.dat and pb datasheet... But more concerning is vcc/gnd pinout comment, that You gave to me... That's something I did not check yet. I'll report whether it is .dat or the pinout problem.

BR
Andrej
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Tue Jul 19, 2016 7:50 am    Post subject: Reply with quote

AT06609: Differences between ATmega48/88/168 Variants and the New ATmega48/88/168PB
Not much special changed.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
andro

Bascom Member



Joined: 12 Mar 2007
Posts: 94
Location: Ljubljana

slovenia.gif
PostPosted: Tue Jul 19, 2016 8:57 am    Post subject: Reply with quote

Hi!

Thanks for the link, Evert. I was able to find this link yesterday http://www.atmel.com/Images/doc8196.pdf, but the one, You sent today is what I was looking for.
Those additional PE0 and PE1 are now tight to Vcc and GND (I did the layout on mega8 pinout base) , but I think, this may not cause any problems.


BR
Andrej
Back to top
View user's profile
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 902
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Sat Jul 30, 2016 8:32 pm    Post subject: Reply with quote

Not much changed?????

Take a look at the "Alternate Functions of Port E" on page 122 of the full Datasheet!

Pins 3, 6, 19 and 22 changed and or added many functions.

PE3 ADC7, T3, MOSI1, PCINT27
PE2 ADC6, ICP3, SS1, PCINT26
PE1 T4, SCL1, PCINT25
PE0 ACO, ICP4, SDA1, PCINT24

Also see overriding signals on Page 123 with a Master/Slave select SPI

Have fun
Hubert
Back to top
View user's profile
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 902
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Sat Jul 30, 2016 9:20 pm    Post subject: Reply with quote

I use the Atmega168 (AU and PU versions) a lot in my projects.

@Mark Alberts,
the alternate functions of port E bits 0-3 seem to be not implemented in the new m168PBdef.dat.
Looking through the file, I could not find any other than Port, Pin and DDR definitions.
There should be the PCINT's, SPI1, Master/Slave select, TWI1, counter inputs T3, T4, ACO, ......
For example PCINT stops at 23.
There is on Port E 24 to 27.
Did I just not find it because of differing names, or will it be added at a later time?
It is a significant improvement of the chip and adds functions to otherwise useless pins.
Currently it seems that we can only use Port E as general I/O.
It also sometimes would allow the use of the 168PB chip instead of a larger and more expensive one.
Please correct me if I am wrong.
Thanks
Hubert
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Sat Jul 30, 2016 9:58 pm    Post subject: Reply with quote

hgrueneis wrote:
Not much changed?????

The ts was migrating from the mega8 to mega168pb and encountered some strange behavior.
My "Not much special changed" was regarding the downwards compatibility with the m8 and this should give no problems.
I think the same with the def file Marc created quickly (within 30 minutes), only to make it downwards compatible and helping the ts going on .
Hopefully Marc has some time to implement the new features also in the def file.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 68
Location: Ljubljana

slovenia.gif
PostPosted: Mon Sep 24, 2018 6:50 am    Post subject: Reply with quote

Hi,

does any of you have updated/new DEF file for Mega168PB? This chip does have a bunch of new features that Mega168 does not have.

Best regards
Jure
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Mon Sep 24, 2018 10:15 am    Post subject: Reply with quote

attached the official dat file.
_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
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